logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominik Psenner (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (LOG4NET-340) Exception during StringFormat: Input string was not in a correct format.
Date Mon, 21 May 2012 09:27:42 GMT

    [ https://issues.apache.org/jira/browse/LOG4NET-340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13280050#comment-13280050
] 

Dominik Psenner edited comment on LOG4NET-340 at 5/21/12 9:26 AM:
------------------------------------------------------------------

This is actually not a bug. The string you pass in contains a "{", which in turn is passed
on to the string.Format() method that raises a StringFormatException because it cannot format
"{\n[..]". You will have to escape every "{" and "}" with "{{" and "}}" if you do want that
those are processed by the string.Format() method.
                
      was (Author: nachbarslumpi):
    This is actually not a bug. The string you pass in contains a "{", which in turn is passed
on to the string.Format() method that raises a StringFormatException because it cannot format
"{\n[..]". You will have to escape every "{" and "}" with "{{" and "}}" if you want to view
it in the logfiles as it is.
                  
> Exception during StringFormat: Input string was not in a correct format. 
> -------------------------------------------------------------------------
>
>                 Key: LOG4NET-340
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-340
>             Project: Log4net
>          Issue Type: Bug
>    Affects Versions: 1.2.10
>            Reporter: Deepak Kumar Bhatt
>
> We are encountering following error when we use following debugger statement in code.
This request is a JSON request which is a valid format in JSON but still log4net 1.2.10.0
logs this message.
> <<<Code>>>
>  Logger.Debugger("request=" + request);
> <<<Error Message in Logger >>>
> <log4net.Error>Exception during StringFormat: Input string was not in a correct
format. <format>request={ 
>   "ID": "xxxx-xxxxx-xxxx-xxxx-xxxx", 
>   "zipFile": "Test.docx__04052012105400.authoring.gz", 
>   "actualFile": "Test02052012222046.docx", 
>   "UserID": "bhatt", 
>   "groupID": "GroupA", 
>   "groupFromUI": "GroupA" 
> }</format><args>{}</args></log4net.Error> 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message