You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chukwa.apache.org by "Jerome Boulon (JIRA)" <ji...@apache.org> on 2009/03/19 20:48:50 UTC

[jira] Created: (CHUKWA-41) ChukwaLog4jAppender does not escape \n for exception

ChukwaLog4jAppender does not escape \n for exception
----------------------------------------------------

                 Key: CHUKWA-41
                 URL: https://issues.apache.org/jira/browse/CHUKWA-41
             Project: Hadoop Chukwa
          Issue Type: Bug
            Reporter: Jerome Boulon
            Assignee: Jerome Boulon
            Priority: Blocker




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CHUKWA-41) ChukwaLog4jAppender does not escape \n for exception

Posted by "Jerome Boulon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CHUKWA-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jerome Boulon updated CHUKWA-41:
--------------------------------

    Status: Patch Available  (was: Open)

out.info("test 1", new RuntimeException("my long exception \n line2", new IOException("in IO exception")));
out.info("test 2");
out.info("test 3 with \n a new line here");

Output:

2009-03-25 11:16:14,803 INFO main Test1 - test 1^D
java.lang.RuntimeException: my long exception ^D
 line2^D
        at Test1.main(Test1.java:17)^D
Caused by: java.io.IOException: in IO exception^D
        ... 1 more
2009-03-25 11:16:14,827 INFO main Test1 - test 2
2009-03-25 11:16:14,827 INFO main Test1 - test 3 with ^D
 a new line here


> ChukwaLog4jAppender does not escape \n for exception
> ----------------------------------------------------
>
>                 Key: CHUKWA-41
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-41
>             Project: Hadoop Chukwa
>          Issue Type: Bug
>            Reporter: Jerome Boulon
>            Assignee: Jerome Boulon
>            Priority: Blocker
>         Attachments: CHUKWA-41.patch
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CHUKWA-41) ChukwaLog4jAppender does not escape \n for exception

Posted by "Jerome Boulon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CHUKWA-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12683587#action_12683587 ] 

Jerome Boulon commented on CHUKWA-41:
-------------------------------------

//escape the newlines from record bodies and then write this record to the log file
		  this.qw.write(RecordConstants.escapeAllButLastRecordSeparator("\n",this.layout.format(event)));

		  if(layout.ignoresThrowable()) {
			  String[] s = event.getThrowableStrRep();
			  if (s != null) {
				  int len = s.length;
				  for(int i = 0; i < len; i++) {
					  this.qw.write(s[i]);
					  this.qw.write(Layout.LINE_SEP);
				  }
			  }
		  }

should be 
//escape the newlines from record bodies and then write this record to the log file
		  this.qw.write(RecordConstants.escapeAllButLastRecordSeparator("\n",this.layout.format(event)));

		  if(layout.ignoresThrowable()) {
			  String[] s = event.getThrowableStrRep();
			  if (s != null) {
				  int len = s.length;
				  for(int i = 0; i < len; i++) {
					  this.qw.write(s[i]);
					  this.qw.write(CTRL_D + "\n");
				  }
			  }
		  }

> ChukwaLog4jAppender does not escape \n for exception
> ----------------------------------------------------
>
>                 Key: CHUKWA-41
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-41
>             Project: Hadoop Chukwa
>          Issue Type: Bug
>            Reporter: Jerome Boulon
>            Assignee: Jerome Boulon
>            Priority: Blocker
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CHUKWA-41) ChukwaLog4jAppender does not escape \n for exception

Posted by "Jerome Boulon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CHUKWA-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jerome Boulon updated CHUKWA-41:
--------------------------------

    Comment: was deleted

(was: //escape the newlines from record bodies and then write this record to the log file
		  this.qw.write(RecordConstants.escapeAllButLastRecordSeparator("\n",this.layout.format(event)));

		  if(layout.ignoresThrowable()) {
			  String[] s = event.getThrowableStrRep();
			  if (s != null) {
				  int len = s.length;
				  for(int i = 0; i < len; i++) {
					  this.qw.write(s[i]);
					  this.qw.write(Layout.LINE_SEP);
				  }
			  }
		  }

)

> ChukwaLog4jAppender does not escape \n for exception
> ----------------------------------------------------
>
>                 Key: CHUKWA-41
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-41
>             Project: Hadoop Chukwa
>          Issue Type: Bug
>            Reporter: Jerome Boulon
>            Assignee: Jerome Boulon
>            Priority: Blocker
>         Attachments: CHUKWA-41.patch
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (CHUKWA-41) ChukwaLog4jAppender does not escape \n for exception

Posted by "Jerome Boulon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CHUKWA-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12683587#action_12683587 ] 

Jerome Boulon edited comment on CHUKWA-41 at 3/25/09 11:20 AM:
---------------------------------------------------------------

//escape the newlines from record bodies and then write this record to the log file
		  this.qw.write(RecordConstants.escapeAllButLastRecordSeparator("\n",this.layout.format(event)));

		  if(layout.ignoresThrowable()) {
			  String[] s = event.getThrowableStrRep();
			  if (s != null) {
				  int len = s.length;
				  for(int i = 0; i < len; i++) {
					  this.qw.write(s[i]);
					  this.qw.write(Layout.LINE_SEP);
				  }
			  }
		  }



      was (Author: jboulon):
    //escape the newlines from record bodies and then write this record to the log file
		  this.qw.write(RecordConstants.escapeAllButLastRecordSeparator("\n",this.layout.format(event)));

		  if(layout.ignoresThrowable()) {
			  String[] s = event.getThrowableStrRep();
			  if (s != null) {
				  int len = s.length;
				  for(int i = 0; i < len; i++) {
					  this.qw.write(s[i]);
					  this.qw.write(Layout.LINE_SEP);
				  }
			  }
		  }

should be 
//escape the newlines from record bodies and then write this record to the log file
		  this.qw.write(RecordConstants.escapeAllButLastRecordSeparator("\n",this.layout.format(event)));

		  if(layout.ignoresThrowable()) {
			  String[] s = event.getThrowableStrRep();
			  if (s != null) {
				  int len = s.length;
				  for(int i = 0; i < len; i++) {
					  this.qw.write(s[i]);
					  this.qw.write(CTRL_D + "\n");
				  }
			  }
		  }
  
> ChukwaLog4jAppender does not escape \n for exception
> ----------------------------------------------------
>
>                 Key: CHUKWA-41
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-41
>             Project: Hadoop Chukwa
>          Issue Type: Bug
>            Reporter: Jerome Boulon
>            Assignee: Jerome Boulon
>            Priority: Blocker
>         Attachments: CHUKWA-41.patch
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CHUKWA-41) ChukwaLog4jAppender does not escape \n for exception

Posted by "Ari Rabkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CHUKWA-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ari Rabkin updated CHUKWA-41:
-----------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

I just committed this.  Thanks, Jerome!

> ChukwaLog4jAppender does not escape \n for exception
> ----------------------------------------------------
>
>                 Key: CHUKWA-41
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-41
>             Project: Hadoop Chukwa
>          Issue Type: Bug
>            Reporter: Jerome Boulon
>            Assignee: Jerome Boulon
>            Priority: Blocker
>         Attachments: CHUKWA-41.patch
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CHUKWA-41) ChukwaLog4jAppender does not escape \n for exception

Posted by "Jerome Boulon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CHUKWA-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jerome Boulon updated CHUKWA-41:
--------------------------------

    Attachment: CHUKWA-41.patch

> ChukwaLog4jAppender does not escape \n for exception
> ----------------------------------------------------
>
>                 Key: CHUKWA-41
>                 URL: https://issues.apache.org/jira/browse/CHUKWA-41
>             Project: Hadoop Chukwa
>          Issue Type: Bug
>            Reporter: Jerome Boulon
>            Assignee: Jerome Boulon
>            Priority: Blocker
>         Attachments: CHUKWA-41.patch
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.