How to configure log4j for a druid noide

516 views
Skip to first unread message

dav...@blismedia.com

unread,
Jul 29, 2014, 4:37:23 AM7/29/14
to druid-de...@googlegroups.com
Hi,
I am currently deploying my nodes on a few machines and I was actually wondering about the best method to deal with log files.
As far as I know, Druid is using log4j. I have tried to drop a log4j.properties in the same folder of the realtime.properties file, but with no luck.

What's the right way of doing this?

Thanks,
Davide




This email and any attachments to it may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of BlisMedia Ltd, a company registered in England and Wales with registered number 06455773. Its registered office is 3rd Floor, 101 New Cavendish St, London, W1W 6XH, United Kingdom.

If you are not the intended recipient of this email, you must neither take any action based upon its contents, nor copy or show it to anyone. Please contact the sender if you believe you have received this email in error. 

Davide Anastasia

unread,
Jul 29, 2014, 4:48:42 AM7/29/14
to druid-de...@googlegroups.com
Alright, I have managed using -Dlog4j.configuration. Is that the right way?

D.


--
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/CffgIKsaNSs/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/71e48731-d20f-45ab-b521-c74a17a46868%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Davide Anastasia

unread,
Aug 20, 2014, 11:36:41 AM8/20/14
to druid-de...@googlegroups.com
Hi,
Despite thinking that I had managed to do this, I am still stuck. I have read the page http://druid.io/docs/0.6.145/Logging.html , and wrote my new log4j.xml file:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

  <appender name="FileAppender" class="org.apache.log4j.DailyRollingFileAppender">
    <param name="file" value="/mnt/druid/logs/historical.log" />
    <param name="MaxBackupIndex" value="5" />
    <param name="MaxFileSize" value="10MB" />
    <param name="DatePattern" value="'.'yyyy-MM-dd-HH" />

    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d{ISO8601} %-5p [%t] %c - %m%n"/>
    </layout>
  </appender>

  <!-- ServerView-related stuff is way too chatty -->
  <logger name="io.druid.client.BatchServerInventoryView">
    <level value="warn"/>
  </logger>
  <logger name="io.druid.curator.inventory.CuratorInventoryManager">
    <level value="warn"/>
  </logger>

  <root>
    <priority value="INFO" />
    <appender-ref ref="FileAppender"/>
  </root>

</log4j:configuration>

Unfortunately, either storing the file in the classpath (same directory where my runtime.properties is stored), or using the -Dlog4j.properties=... is helping. 

I am using 0.6.130 currently, but I can switch to another version, if required. 

Can anybody give me an hint of what I am doing wrong?

Thanks,
Davide

Gian Merlino

unread,
Aug 20, 2014, 11:46:56 AM8/20/14
to druid-de...@googlegroups.com
Putting it on your classpath should work, as long as it is before the jars. We do something like "java -cp conf:druid-foo.jar io.druid.cli.Main server broker" where "conf" is a directory containing the log4j.xml. Does it still not get picked up if you do something like that?

Davide Anastasia

unread,
Aug 20, 2014, 11:58:49 AM8/20/14
to druid-de...@googlegroups.com
Thanks Gian,
it does work if I invert the order!

Cheers,
Davide



For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Kiran Raj

unread,
Jan 5, 2017, 7:17:16 AM1/5/17
to Druid Development, dav...@blismedia.com
Hello guys,
 I am trying to make changes to my log4j2.xml file under(/opt/druid/conf/druid/_common) 

 Once I make the changes how do I see the changes should I restart something ??

Thanks!
-Kiran

Gian Merlino

unread,
Jan 5, 2017, 10:36:59 AM1/5/17
to druid-de...@googlegroups.com, dav...@blismedia.com
Yes, you should restart all your Druid services to pick up the changes. I think log4j2 has a "watching" mode but that isn't configured by default.

Gian

--
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-development+unsubscribe@googlegroups.com.
To post to this group, send email to druid-development@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/druid-development/6a6cdeb5-481f-426d-a31b-81d4180212f6%40googlegroups.com.

Kiran Raj

unread,
Jan 6, 2017, 5:32:28 AM1/6/17
to Druid Development, dav...@blismedia.com
Thanks. Restarting the Druid services helped. 



On Thursday, January 5, 2017 at 9:06:59 PM UTC+5:30, Gian Merlino wrote:
Yes, you should restart all your Druid services to pick up the changes. I think log4j2 has a "watching" mode but that isn't configured by default.

Gian

On Thu, Jan 5, 2017 at 4:17 AM, Kiran Raj <kiranf...@gmail.com> wrote:
Hello guys,
 I am trying to make changes to my log4j2.xml file under(/opt/druid/conf/druid/_common) 

 Once I make the changes how do I see the changes should I restart something ??

Thanks!
-Kiran

--
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.

Kiran Raj

unread,
Jan 16, 2017, 5:30:44 AM1/16/17
to Druid Development, dav...@blismedia.com
Hello again,
 I am working with druid and I have a situation.
 I need a log4j2.xml under druid/conf/druid/_common that can take care of all the log file(Broker,Coordinator etc). 
 
Problem I am facing:-
 when I add multiple "RollingFile" to handle each of the .log file. But it seems to go wrong.

Can you help me solve this? 

Gian Merlino

unread,
Jan 16, 2017, 5:45:28 AM1/16/17
to druid-de...@googlegroups.com
What's going wrong exactly?

Gian

To unsubscribe from this group and stop receiving emails from it, send an email to druid-development+unsubscribe@googlegroups.com.
To post to this group, send email to druid-development@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/druid-development/ba819fc8-d3e3-47bf-bafb-c9169582b2f2%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages