Subject: | Expanding %X{nosuchkey} to "[undef]" can be undesirable behavior |
Hello,
I'm using the MDC to stash interesting data for more searchable logging.
In particular I have a method in my DBIC schema that users can call to
set the "current running application" and be able to identify the
application later. It basically looks like
$schema->register_logged_application("foo");
The issue is that logging can happen before the schema has been
instantiated, so the application is not registered yet. The DBI
appender gets %X{application_run} for insertion into a table with a
foreign key constraint, but it's undef, so it tries to insert "[undef]"
into the INTEGER FOREIGN KEY column, which causes an error. I expected
the appender to insert NULL instead, as you'd get if you used DBI
directly. This is obviously because the appender uses PatternLayout to
handle the params. Attached is my L4P configuration.
Is there a workaround for this?
Subject: | l4p_anonymized.conf |
Message body not shown because it is not plain text.