[
https://issues.apache.org/jira/browse/LOG4NET-558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15951963#comment-15951963
]
Chris Bodolus edited comment on LOG4NET-558 at 4/1/17 3:30 AM:
---------------------------------------------------------------
Hi [~os.varlamov],
>From the
>[documentation|https://logging.apache.org/log4net/log4net-1.2.13/release/sdk/log4net.Layout.PatternLayout.html]
> - {quote}Each conversion specifier starts with a percent sign (%) and is
>followed by optional format modifiers and a conversion pattern name.{quote}
Specifically regarding the _property_ conversion pattern name {quote}Used to
output an event specific property. The key to lookup must be specified within
braces and directly following the pattern specifier, e.g.
{code}%property{user}{code} would include the value from the property that is
keyed by the string 'user'.[...]Properties are added to events by loggers or
appenders[...]If no key is specified, (e.g. %property) then *all the keys and
their values are printed in a comma separated list*.{quote}
It looks like your logger is parsing this portion ok, {code}%date [%thread]
%-5level %logger [{code}, gets to the _property_ conversion pattern name and
chokes. Based on the documentation, I would have assumed if NDC was a
non-existent key, nothing would have been printed, and it would have picked
back up with logging the message, though my understanding may be off.
Is it possible for you to confirm whether the value for key NDC is persisted by
your appenders? Is that NDC value needed by your clients - perhaps you could
remove that portion of the patternLayout until a fix is determined. That would
at least get you the messages still. :)
Regards,
- Chris Bodolus
Here's the log output from above:
{noformat}
2017-03-07 05:45:23,250 [1] WARN Driver [
2017-03-07 05:45:32,718 [1] INFO Driver [
2017-03-07 05:45:36,515 [1] INFO Driver [
2017-03-07 05:45:37,843 [1] INFO Driver [
2017-03-07 05:45:37,875 [1] INFO Driver [
2017-03-07 05:45:38,125 [1] INFO WebcashClient [
2017-03-07 05:45:40,828 [7] INFO Driver [
2017-03-07 05:45:40,937 [7] INFO Driver [
2017-03-07 05:45:41,093 [7] INFO Driver [
2017-03-07 05:45:41,296 [7] INFO Driver [
2017-03-07 05:45:41,328 [7] INFO Driver [
2017-03-07 05:45:41,328 [7] INFO Driver [
2017-03-07 05:45:41,343 [7] INFO Driver [
2017-03-07 05:45:41,343 [7] INFO Driver [
2017-03-07 05:45:41,375 [7] INFO Driver [
2017-03-07 05:45:41,375 [7] INFO Driver [
2017-03-07 05:45:41,531 [7] INFO Driver [
2017-03-07 05:45:41,531 [7] INFO Driver [
2017-03-07 05:45:41,562 [6] INFO Driver [
2017-03-07 05:45:41,562 [6] INFO Driver [
2017-03-07 05:45:41,578 [6] INFO Driver [
2017-03-07 05:45:41,578 [6] INFO Driver [
2017-03-07 05:45:41,593 [6] INFO Driver [
2017-03-07 05:45:41,593 [6] INFO Driver [
2017-03-07 05:45:41,609 [6] INFO Driver [
2017-03-07 05:45:41,609 [6] INFO Driver [
2017-03-07 05:45:41,625 [6] INFO Driver [
2017-03-07 05:45:41,625 [6] INFO Driver [
2017-03-07 05:45:41,640 [1] INFO WebcashClient [
2017-03-07 05:45:41,781 [6] INFO Driver [
2017-03-07 05:45:41,781 [6] INFO Driver [
2017-03-07 05:45:41,859 [6] ...
{noformat}
was (Author: cbodolus):
Hi [~os.varlamov],
>From the
>[documentation|https://logging.apache.org/log4net/log4net-1.2.13/release/sdk/log4net.Layout.PatternLayout.html]
> - {quote}Each conversion specifier starts with a percent sign (%) and is
>followed by optional format modifiers and a conversion pattern name.{quote}
Specifically regarding the _property_ conversion pattern name {quote}Used to
output an event specific property. The key to lookup must be specified within
braces and directly following the pattern specifier, e.g.
{code}%property{user}{code} would include the value from the property that is
keyed by the string 'user'.[...]Properties are added to events by loggers or
appenders[...]If no key is specified, (e.g. %property) then *all the keys and
their values are printed in a comma separated list*.{quote}
It looks like your logger is parsing this portion ok, {code}%date [%thread]
%-5level %logger [{code}, gets to the _property_ conversion pattern name and
gets in a recursive loop. Based on the documentation, I would have assumed if
NDC was a non-existent key, nothing would have been printed rather than
everything - though my interpretation might be off.
Is it possible for you to confirm whether the value for key NDC is persisted by
your appenders? Is that NDC value needed by your clients - perhaps you could
remove that portion of the patternLayout until a fix is determined.
Regards,
- Chris Bodolus
> log4net 2.0.7 and greater doesn't log %message pattern
> ------------------------------------------------------
>
> Key: LOG4NET-558
> URL: https://issues.apache.org/jira/browse/LOG4NET-558
> Project: Log4net
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.0.7, 2.0.8
> Environment: Windows XP SP3 Home Edition
> Reporter: Varlamov Oleg
> Priority: Critical
> Fix For: 1.2.15
>
>
> When we are updated log4net from 1.2.15 to 2.0.7 some of our customers report
> about wrong logging in RollingFileAppender.
> Log file looks like:
> 2017-03-07 05:45:23,250 [1] WARN Driver [2017-03-07 05:45:32,718 [1] INFO
> Driver [2017-03-07 05:45:36,515 [1] INFO Driver [2017-03-07 05:45:37,843 [1]
> INFO Driver [2017-03-07 05:45:37,875 [1] INFO Driver [2017-03-07
> 05:45:38,125 [1] INFO WebcashClient [2017-03-07 05:45:40,828 [7] INFO
> Driver [2017-03-07 05:45:40,937 [7] INFO Driver [2017-03-07 05:45:41,093 [7]
> INFO Driver [2017-03-07 05:45:41,296 [7] INFO Driver [2017-03-07
> 05:45:41,328 [7] INFO Driver [2017-03-07 05:45:41,328 [7] INFO Driver
> [2017-03-07 05:45:41,343 [7] INFO Driver [2017-03-07 05:45:41,343 [7] INFO
> Driver [2017-03-07 05:45:41,375 [7] INFO Driver [2017-03-07 05:45:41,375 [7]
> INFO Driver [2017-03-07 05:45:41,531 [7] INFO Driver [2017-03-07
> 05:45:41,531 [7] INFO Driver [2017-03-07 05:45:41,562 [6] INFO Driver
> [2017-03-07 05:45:41,562 [6] INFO Driver [2017-03-07 05:45:41,578 [6] INFO
> Driver [2017-03-07 05:45:41,578 [6] INFO Driver [2017-03-07 05:45:41,593 [6]
> INFO Driver [2017-03-07 05:45:41,593 [6] INFO Driver [2017-03-07
> 05:45:41,609 [6] INFO Driver [2017-03-07 05:45:41,609 [6] INFO Driver
> [2017-03-07 05:45:41,625 [6] INFO Driver [2017-03-07 05:45:41,625 [6] INFO
> Driver [2017-03-07 05:45:41,640 [1] INFO WebcashClient [2017-03-07
> 05:45:41,781 [6] INFO Driver [2017-03-07 05:45:41,781 [6] INFO Driver
> [2017-03-07 05:45:41,859 [6] ...
> As I understood it can't handle "[%property{NDC}] - %message%newline" pattern.
> Appender configuration:
> <appender name="Driver" type="log4net.Appender.RollingFileAppender">
> <file value="Driver" />
> <appendToFile value="true" />
> <encoding value="utf-8" />
> <rollingStyle value="Date" />
> <datePattern value="_yyyy-MM-dd'.log'" />
> <layout type="log4net.Layout.PatternLayout">
> <conversionPattern value="%date [%thread] %-5level %logger
> [%property{NDC}] - %message%newline" />
> </layout>
> <threshold value="DEBUG" />
> </appender>
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)