hadoop-zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mahadev Konar <maha...@yahoo-inc.com>
Subject Re: specifying the location of zookeeper.log
Date Fri, 16 Oct 2009 18:59:25 GMT
Sorry some misinformation from my side.

You can actually change the log4j properties to get it to write to a file.

Using the following in your log4j properties file

log4j.rootLogger=INFO, FILE

log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File={$dir}/zoo.log
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d{ISO8601} - %-5p
[%t:%C{1}@%L] - %m%n


Will let you log to the output directory $dir.


Hope that helps!

mahadev


On 10/16/09 11:35 AM, "Mahadev Konar" <mahadev@yahoo-inc.com> wrote:

> Hi Leonard,
>  Looks like you are right. bin/zkServer.sh just logs the output to console,
> so you should be able to redirect to any file you want. No?
> 
> Anyways this is a bug. Please open a jira for it.
> 
> Thanks
> mahadev
> 
> 
> On 10/16/09 11:27 AM, "Leonard Cuff" <lcuff@valueclick.com> wrote:
> 
>> 
>> I should have mentioned in my original email, but I had already tried
>> setting ZOO_LOG_DIR as an environment variable. I am using zkServer.sh and I
>> see where it passes ZOO_LOG_DIR as a parameter to the java invocation.
>> 
>>  java  "-Dzookeeper.log.dir=${ZOO_LOG_DIR}"
>> "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
>>      -cp $CLASSPATH $JVMFLAGS $ZOOMAIN $ZOOCFG &
>> 
>> 
>> I double checked by echo'ing the value of ZOO_LOG_DIR just before the java
>> command. It's set correctly ... but it has no effect on the location of
>> zookeeper.log :-(
>> 
>> Leonard
>> 
>> On 10/16/09 11:08 AM, "Mahadev Konar" <mahadev@yahoo-inc.com> wrote:
>> 
>>> Hi Leonard,
>>>   You should be able to set the ZOO_LOG_DIR as an environment variable to
>>> get a different log directory. I think you are using bin/zkServer.sh to
>>> start the server?
>>> 
>>> Also, please open a jira for this. It would be good to fix the documentation
>>> for this.
>>> 
>>> Thanks
>>> mahadev
>>> 
>>> 
>>> On 10/16/09 11:04 AM, "Leonard Cuff" <lcuff@valueclick.com> wrote:
>>> 
>>>> I¹ve read through the admin manual at
>>>> 
http://hadoop.apache.org/zookeeper/docs/current/zookeeperAdmin.html#sc_logg>>>>
i
>>>> ng
>>>> and I don¹t see that there is any way to specify a location for the
>>>> server¹s
>>>> own log file.  zookeeper.log appears in the bin directory, regardless of
>>>> setting dataDir or dataLogDir in the configuration file. Am I overlooking
>>>> something?  Is there a way to have this file appear somewhere else?
>>>> 
>>>> TIA,
>>>> 
>>>> Leonard
>>> 
> 


Mime
View raw message