[ 
https://issues.apache.org/jira/browse/PIG-1215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12832775#action_12832775
 ] 

Ashutosh Chauhan commented on PIG-1215:
---------------------------------------

Pig already has extensive support for logging via log4j. Applications wanting 
to mine pig logs can configure the pig logging using -4 option of Pig. for 
example if you provide "pig -4 logger.conf myscript.pig" log4j properties 
specified in file logger.conf will be picked up. So, application can configure 
log4j as they want. One such config which I tried is following:
{noformat}
 $ cat logger.conf 
log4j.rootLogger=INFO, R
log4j.logger.org.apache.pig=INFO
log4j.appender.R=org.apache.log4j.RollingFileAppender
# file name in which log messages will be printed.
log4j.appender.R.File=piglogs.log
log4j.appender.R.MaxFileSize=100KB

# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
{noformat}

Above log4j configuration prints all the info level messages in piglogs.log 
file. All the other properties of log4j (like log rotation, format of log 
messages etc) is configurable through this file. More info at: 
http://logging.apache.org/log4j/1.2/manual.html

Thus no new property or any other change in Pig is required to redirect log 
messages to file. 

Unit test failure is one of those temporary "port out of range" failures 
unrelated to patch. Javac warning is deprecation warning due to use of a 
deprecated Hadoop api. These deprecation warnings will be addressed when we 
move to new Hadoop api.

This patch is ready for review. 

> Make Hadoop jobId more prominent in the client log
> --------------------------------------------------
>
>                 Key: PIG-1215
>                 URL: https://issues.apache.org/jira/browse/PIG-1215
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Olga Natkovich
>            Assignee: Ashutosh Chauhan
>             Fix For: 0.7.0
>
>         Attachments: pig-1215.patch, pig-1215.patch
>
>
> This is a request from applications that want to be able to programmatically 
> parse client logs to find hadoop Ids.
> The woould like to see each job id on a separate line in the following format:
> hadoopJobId: job_123456789
> They would also like to see the jobs in the order they are executed.

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

Reply via email to