You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Deepak Kumar Bhatt (JIRA)" <ji...@apache.org> on 2012/05/21 07:45:40 UTC
[jira] [Created] (LOG4NET-340) Exception during StringFormat: Input
string was not in a correct format.
Deepak Kumar Bhatt created LOG4NET-340:
------------------------------------------
Summary: 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
[jira] [Commented] (LOG4NET-340) Exception during StringFormat:
Input string was not in a correct format.
Posted by "Deepak Kumar Bhatt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4NET-340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13288093#comment-13288093 ]
Deepak Kumar Bhatt commented on LOG4NET-340:
--------------------------------------------
I got the resolution, thanks for your replies. Yes we were internally using Infoformat.
> 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
> Assignee: Dominik Psenner
>
> 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
[jira] [Commented] (LOG4NET-340) Exception during StringFormat:
Input string was not in a correct format.
Posted by "Dominik Psenner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4NET-340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13280050#comment-13280050 ]
Dominik Psenner commented on LOG4NET-340:
-----------------------------------------
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
[jira] [Closed] (LOG4NET-340) Exception during StringFormat: Input
string was not in a correct format.
Posted by "Dominik Psenner (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4NET-340?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dominik Psenner closed LOG4NET-340.
-----------------------------------
Resolution: Invalid
Assignee: Dominik Psenner
> 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
> Assignee: Dominik Psenner
>
> 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
[jira] [Commented] (LOG4NET-340) Exception during StringFormat:
Input string was not in a correct format.
Posted by "Stefan Bodewig (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LOG4NET-340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13288011#comment-13288011 ]
Stefan Bodewig commented on LOG4NET-340:
----------------------------------------
I'll immediately agree with Dominilk if Deepak know the Debugger method is invoking string.format inside.
@Deepak where does the Debugger method come from? Is it one of yours? I can' find one in log4net.
> 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
> Assignee: Dominik Psenner
>
> 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
[jira] [Comment Edited] (LOG4NET-340) Exception during
StringFormat: Input string was not in a correct format.
Posted by "Dominik Psenner (JIRA)" <ji...@apache.org>.
[ 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