Enable Debug logging for Realtime Task

703 views
Skip to first unread message

Deepak Jain

unread,
Aug 21, 2014, 3:38:20 AM8/21/14
to druid-de...@googlegroups.com
Druid Version: .145
Moving the discussion here so that it can benefit others.

I want to enable DEBUG level logging for realtime tasks started by Middle Manager. Steps suggested were as below and i attempted the following

1. Create a log4j.xml as attached..
2. I placed the above file in MM machine at /opt/druid/druid-services-0.6.145/config/overlord/log4j.xml 
3. Note that the log4j file has FILE appender with 
<param name="File" value="task.log" />
and
<logger name="io.druid.indexing.common.task.RealtimeIndexTask">
<level value="TRACE" />
<appender-ref ref="FILE" />
</logger>

4. I started MM as 

$ export JAVA_HOME=/opt/druid/packages/jdk1.7.0_67
$ export PATH=$PATH:$JAVA_HOME/bin
$ export DRUID_HOME=/opt/druid/druid-services-0.6.145
$ java -Ddruid.indexer.fork.property.log4j.configuration=$DRUID_HOME/config/overlord/log4j.xml -server -Xmx1g -Xms1g -XX:+UseConcMarkSweepGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Duser.timezone=UTC -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/tmp -classpath /opt/druid/druid-services-0.6.138/lib/*:/opt/druid/druid-services-0.6.138/config/overlord:/apache/hadoop/conf:/apache/hadoop/share/hadoop/hdfs/hadoop-hdfs-2.4.1-EBAY-2.jar:/apache/hadoop/share/hadoop/common/hadoop-common-2.4.1-EBAY-2.jar:/apache/hadoop/share/hadoop/common/lib/commons-collections-3.2.1.jar:/apache/hadoop/share/hadoop/common/lib/commons-configuration-1.6.jar:/apache/hadoop/share/hadoop/common/lib/hadoop-auth-2.4.1-EBAY-2.jar:/apache/hadoop/share/hadoop/common/lib/hadoop-ebay-0.1-EBAY-2.jar:/apache/hadoop/share/hadoop/httpfs/tomcat/webapps/webhdfs/WEB-INF/lib/commons-net-3.1.jar io.druid.cli.Main server middleManager

5. I submitted a realtime task to overlord and it started a peon on above MM. (Single MM, Overlord and Peon).
6. When i open the druid overlord console, i see a task and when i click Log(All) link i still see that LOGS are in INFO and NOT DEBUG and i do not see a file task.log .

Questions
1. How will druid send log statements to default log file and the new one ? Or will it merge both 
2. What do i need to change in above statements to get this working.

I think this can be enabling DEBUG for various nodes is worth documenting as Druid usage requires very much internal involvement and will be mostly used by developers.
Offcourse once i get it working i will send out a post so that its atleast documented on groups.

-Deepak
log4j.xml

ÐΞ€ρ@Ҝ (๏̯͡๏)

unread,
Aug 21, 2014, 4:06:22 AM8/21/14
to druid-de...@googlegroups.com
As per my understanding, log4j system looks for log4j.xml or log4j.properties file to initialize its logging system and the same file allows to do customization like change log levels and so on.

With druid, i do not find log4j.xml or log4j.properties in the installable zip file and nor in any of lib/*.jar files. 

1) Where exactly is this file located ? so that one can change the log levels of task
2) Does changing log levels require the above level of involvement or is there any property that is exposed at runtime.properties of java -D level that can be used to change log levels of entire druid or particular package ?

Please suggest. 

I want to enable logs of realtime tasks (MM -> Peon)  as my events are being rejected with serverTime policy and test is very buggy to use. 

I run System.currentTimeInMills() and replace the value of TSTAMP in my incoming data. Hence the record will have NOW as time stamp and must not have been rejected by realtime task as its windowPeriod is P30M.

 Please suggest how to enable DEBUG level logging and will such enabling help resolve the events being thrown away with serverTime as rejectionPolicy.



--
You received this message because you are subscribed to a topic in the Google Groups "Druid Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/druid-development/BvEBJJ6gee0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to druid-developm...@googlegroups.com.
To post to this group, send email to druid-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/druid-development/9b0ce4e3-2fe8-493a-9156-660d6e16bf43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Deepak

Nishant Bangarwa

unread,
Aug 21, 2014, 6:26:04 AM8/21/14
to druid-de...@googlegroups.com
See Inline


On Thu, Aug 21, 2014 at 1:36 PM, ÐΞ€ρ@Ҝ (๏̯͡๏) <deep...@gmail.com> wrote:
As per my understanding, log4j system looks for log4j.xml or log4j.properties file to initialize its logging system and the same file allows to do customization like change log levels and so on.

With druid, i do not find log4j.xml or log4j.properties in the installable zip file and nor in any of lib/*.jar files. 

1) Where exactly is this file located ? so that one can change the log levels of task
you can create a config file yourself and add that to the classpath, make sure that you add the file in classpath prior to druid jars.
2) Does changing log levels require the above level of involvement or is there any property that is exposed at runtime.properties of java -D level that can be used to change log levels of entire druid or particular package ?
you should be able to pass -Dlog4j.configuration.<property>=<value> for any log4j related configuration 
For passing this to peon, prepend it with -Ddruid.indexer.fork.property.log4j.configuration.<property>=<value>

--
You received this message because you are subscribed to the Google Groups "Druid Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to druid-developm...@googlegroups.com.

To post to this group, send email to druid-de...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages