You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (Jira)" <ji...@apache.org> on 2020/04/04 22:30:04 UTC
[jira] [Updated] (LOG4NET-523) .NET message parameter corrupted if
dynamic-string
[ https://issues.apache.org/jira/browse/LOG4NET-523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ralph Goers updated LOG4NET-523:
--------------------------------
LOG4NET is now dormant.
> .NET message parameter corrupted if dynamic-string
> --------------------------------------------------
>
> Key: LOG4NET-523
> URL: https://issues.apache.org/jira/browse/LOG4NET-523
> Project: Log4net
> Issue Type: Bug
> Reporter: Henry K.
> Priority: Trivial
>
> In .NET C# log4net creates line to log file, but line gets corrupted after attempting to enter message data with type that is {code}dynamic { string } {code}
> More details:
> {noformat}
> conversionPattern value="%date [%thread] %-5level %logger::%sourceClass - %message%newline" />
> {noformat}
> -- in place where [ %message ] -is found, everything after that will be removed. Applying next log line to same row.
> Example:
> {code:java}
> // extra conversion is unnecessary, serializer method should return string...
> var data = Convert.ToString(JsonConvert.Serialize(dynamicData));
> // data = type[ dynamic{string} ]
> log.Debug(data);
> {code}
> {noformat}
> 2016-08-11 23:00:00,000 [69] DEBUG MyProject::Namespace.ClassName.Method() - Some debug data
> 2016-08-11 23:00:09,999 [69] DEBUG MyProject::Namespace.ClassName.Method() - Some debug data
> ...
> {noformat}
> -->
> {noformat}
> 2016-08-11 23:00:00,000 [69] DEBUG MyProject::2016-08-11 23:00:09,999 [69] DEBUG MyProject::Namespace.ClassName.Method() - {Some debug data}
> ...
> {noformat}
> This is of course "fixable" or possible to round it by casting that data type to string:
> {code:java}
> // extra conversion is unnecessary, serializer method should return string...
> // data = type[ string ]
> var data = (string)Convert.ToString(JsonConvert.Serialize(dynamicData));
> log.Debug(data);
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)