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

philo vivero commented on HBASE-8126:
-------------------------------------

I think I've failed to provide all information. We tried this, which worked:

hbase.root.logger=INFO,console
our.own.variable=SYSLOG
log4j.rootLogger=${hbase.root.logger},${our.own.variable}

We also tried:

hbase.root.logger=INFO,console,R

Where R was:

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.maxFileSize=2GB
log4j.appender.R.maxBackupIndex=10
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=hbase: %5p [%t] %d{ISO8601} %F (line 
%L) %m%n
log4j.appender.R.File=/var/log/hbase/hbase-hbase-regionserver-hostname.log

And that seemed to work (though we're not 100% sure - that's pretty close to 
DRFA).

We have about 90% certainty that the ENV variable is clobbering any attempt to 
add a SYSLOG entry. Our SYSLOG entry looks like this:

log4j.appender.SYSLOG=org.apache.log4j.net.SyslogAppender
log4j.appender.SYSLOG.syslogHost=syslogHost:514
log4j.appender.SYSLOG.layout=org.apache.log4j.PatternLayout
log4j.appender.SYSLOG.layout.ConversionPattern=hbase: %d{ISO8601} %p %c: %m%n
log4j.appender.SYSLOG.facility=LOCAL7

Hopefully I didn't just muddy the waters, but just wanted to point out that 
there seems to be a small amount of evidence that contradicts my description 
above, though only in a minor way.
                
> log4j hbase.root.logger is always overwritten by ENV, even if not defined
> -------------------------------------------------------------------------
>
>                 Key: HBASE-8126
>                 URL: https://issues.apache.org/jira/browse/HBASE-8126
>             Project: HBase
>          Issue Type: Bug
>          Components: regionserver
>    Affects Versions: 0.92.1
>         Environment: Ubuntu Linux 10.04 LTS
>            Reporter: philo vivero
>
> Go to log4j.properties. Note this sequence of definitions:
> hbase.root.logger=INFO,console
> log4j.rootLogger=${hbase.root.logger}
> One would think they could change hbase.root.logger to something else. Say 
> "INFO,console,SYSLOG" and then define syslogging, but they'd be wrong. The 
> syslog won't take effect. The second line will always go back to 
> "INFO,console" (or something, we're not able to determine what it's reverting 
> to exactly).
> What's happening is that the HBASE_ROOT_LOGGER environment variable from 
> hbase-env.sh ALWAYS overwrites that variable before it's used.
> However, in our environment, HBASE_ROOT_LOGGER wasn't being defined. It was 
> commented out. Still, something sets that environment variable to a default 
> and uses it, always clobbering the log4j.properties hbase.root.logger.
> Suggestion: either don't define hbase.root.logger in log4j.properties at all 
> (instead place a comment stating that HBASE_ROOT_LOGGER environment variable 
> in hbase-env.sh is the proper place to change it), or have modifications in 
> log4j take precedence (and comment such in hbase-env.sh).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to