You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Bryan Baugher <bj...@gmail.com> on 2014/11/06 22:28:05 UTC

Set default log levels in a topology jar

Hi everyone,

We recently switched to Storm 0.9.2 which moved to logback. We use the
slf4j API and provide a log4j.properties in our topology jar but noticed
the log levels set in the log4j.properties were not being honored. I read
in the doc for log4j-over-slf4j[1] that 'Note that as a result of this
migration, log4j configuration files will no longer be picked up.' So I
converted my log4j.properties to logback.xml and re-deployed the topology
but the log levels still don't seem to be honored. Does anyone have any
suggestions on things I should try?

[1] - http://www.slf4j.org/legacy.html

Re: Set default log levels in a topology jar

Posted by Bryan Baugher <bj...@gmail.com>.
Logback's documentation on how all the different config files get used
isn't very detailed but this is what I have found,

 * Storm sets -Dlogback.configurationFile option for all of its workers
 * Logback seems to only want 1 config file and picks the one set by the
property first (
https://github.com/qos-ch/logback/blob/v_1.1.1/logback-classic/src/main/java/ch/qos/logback/classic/util/ContextInitializer.java#L118-L136
)

This seems to imply that the storm logback/cluster.xml is the only way to
configure logging settings which also effects the whole cluster or a
specific supervisor if you do it manually.

On Fri Nov 07 2014 at 10:21:02 AM John Reilly <jr...@inconspicuous.org> wrote:

> You do not need to create a logback.xml.  You should use the config that
> is included as part of storm.  $STORM_DIR/logback/cluster.xml
>
> On Fri Nov 07 2014 at 7:04:05 AM Bryan Baugher <bj...@gmail.com> wrote:
>
>> I do see logs the problem is I am trying to increase the log levels from
>> INFO to WARN for a number of packages but still see the INFO messages after
>> deploying the new jar. I used the log4j -> logback translator to create my
>> logback.xml file.
>>
>> On Thu Nov 06 2014 at 5:43:44 PM John Reilly <jr...@inconspicuous.org>
>> wrote:
>>
>>> You said that log levels are not being honored, but it is not clear to
>>> me if this means that you are seeing some logs, but just not seeing finer
>>> grained logs, e.g. DEBUG, or does it mean that you are not seeing any of
>>> the logs that you are expecting to see.
>>>
>>> If you are not seeing any logs, it might be a binding problem.
>>>
>>> If I remember correctly, the only libs that you should include in any
>>> build are the slf4j-api and logback-classic since the logback lib contains
>>> the binding.  If you include any other bindings, you will run into
>>> problems. Examples of other bindings are *slf4j-log4j12-1.7.7.jar, etc.*
>>>
>>> Also, log4j-over-slf4j is only relevant if you have any code that is
>>> logging to log4j directly.  It is not harmful to include it anyway if you
>>> are not sure.
>>>
>>> Cheers,
>>> John
>>>
>>>
>>> On Thu Nov 06 2014 at 1:29:21 PM Bryan Baugher <bj...@gmail.com> wrote:
>>>
>>>> Hi everyone,
>>>>
>>>> We recently switched to Storm 0.9.2 which moved to logback. We use the
>>>> slf4j API and provide a log4j.properties in our topology jar but noticed
>>>> the log levels set in the log4j.properties were not being honored. I read
>>>> in the doc for log4j-over-slf4j[1] that 'Note that as a result of this
>>>> migration, log4j configuration files will no longer be picked up.' So
>>>> I converted my log4j.properties to logback.xml and re-deployed the topology
>>>> but the log levels still don't seem to be honored. Does anyone have any
>>>> suggestions on things I should try?
>>>>
>>>> [1] - http://www.slf4j.org/legacy.html
>>>>
>>>

Re: Set default log levels in a topology jar

Posted by John Reilly <jr...@inconspicuous.org>.
You do not need to create a logback.xml.  You should use the config that is
included as part of storm.  $STORM_DIR/logback/cluster.xml

On Fri Nov 07 2014 at 7:04:05 AM Bryan Baugher <bj...@gmail.com> wrote:

> I do see logs the problem is I am trying to increase the log levels from
> INFO to WARN for a number of packages but still see the INFO messages after
> deploying the new jar. I used the log4j -> logback translator to create my
> logback.xml file.
>
> On Thu Nov 06 2014 at 5:43:44 PM John Reilly <jr...@inconspicuous.org> wrote:
>
>> You said that log levels are not being honored, but it is not clear to me
>> if this means that you are seeing some logs, but just not seeing finer
>> grained logs, e.g. DEBUG, or does it mean that you are not seeing any of
>> the logs that you are expecting to see.
>>
>> If you are not seeing any logs, it might be a binding problem.
>>
>> If I remember correctly, the only libs that you should include in any
>> build are the slf4j-api and logback-classic since the logback lib contains
>> the binding.  If you include any other bindings, you will run into
>> problems. Examples of other bindings are *slf4j-log4j12-1.7.7.jar, etc.*
>>
>> Also, log4j-over-slf4j is only relevant if you have any code that is
>> logging to log4j directly.  It is not harmful to include it anyway if you
>> are not sure.
>>
>> Cheers,
>> John
>>
>>
>> On Thu Nov 06 2014 at 1:29:21 PM Bryan Baugher <bj...@gmail.com> wrote:
>>
>>> Hi everyone,
>>>
>>> We recently switched to Storm 0.9.2 which moved to logback. We use the
>>> slf4j API and provide a log4j.properties in our topology jar but noticed
>>> the log levels set in the log4j.properties were not being honored. I read
>>> in the doc for log4j-over-slf4j[1] that 'Note that as a result of this
>>> migration, log4j configuration files will no longer be picked up.' So I
>>> converted my log4j.properties to logback.xml and re-deployed the topology
>>> but the log levels still don't seem to be honored. Does anyone have any
>>> suggestions on things I should try?
>>>
>>> [1] - http://www.slf4j.org/legacy.html
>>>
>>

Re: Set default log levels in a topology jar

Posted by Bryan Baugher <bj...@gmail.com>.
I do see logs the problem is I am trying to increase the log levels from
INFO to WARN for a number of packages but still see the INFO messages after
deploying the new jar. I used the log4j -> logback translator to create my
logback.xml file.

On Thu Nov 06 2014 at 5:43:44 PM John Reilly <jr...@inconspicuous.org> wrote:

> You said that log levels are not being honored, but it is not clear to me
> if this means that you are seeing some logs, but just not seeing finer
> grained logs, e.g. DEBUG, or does it mean that you are not seeing any of
> the logs that you are expecting to see.
>
> If you are not seeing any logs, it might be a binding problem.
>
> If I remember correctly, the only libs that you should include in any
> build are the slf4j-api and logback-classic since the logback lib contains
> the binding.  If you include any other bindings, you will run into
> problems. Examples of other bindings are *slf4j-log4j12-1.7.7.jar, etc.*
>
> Also, log4j-over-slf4j is only relevant if you have any code that is
> logging to log4j directly.  It is not harmful to include it anyway if you
> are not sure.
>
> Cheers,
> John
>
>
> On Thu Nov 06 2014 at 1:29:21 PM Bryan Baugher <bj...@gmail.com> wrote:
>
>> Hi everyone,
>>
>> We recently switched to Storm 0.9.2 which moved to logback. We use the
>> slf4j API and provide a log4j.properties in our topology jar but noticed
>> the log levels set in the log4j.properties were not being honored. I read
>> in the doc for log4j-over-slf4j[1] that 'Note that as a result of this
>> migration, log4j configuration files will no longer be picked up.' So I
>> converted my log4j.properties to logback.xml and re-deployed the topology
>> but the log levels still don't seem to be honored. Does anyone have any
>> suggestions on things I should try?
>>
>> [1] - http://www.slf4j.org/legacy.html
>>
>

Re: Set default log levels in a topology jar

Posted by John Reilly <jr...@inconspicuous.org>.
You said that log levels are not being honored, but it is not clear to me
if this means that you are seeing some logs, but just not seeing finer
grained logs, e.g. DEBUG, or does it mean that you are not seeing any of
the logs that you are expecting to see.

If you are not seeing any logs, it might be a binding problem.

If I remember correctly, the only libs that you should include in any build
are the slf4j-api and logback-classic since the logback lib contains the
binding.  If you include any other bindings, you will run into problems.
Examples of other bindings are *slf4j-log4j12-1.7.7.jar, etc.*

Also, log4j-over-slf4j is only relevant if you have any code that is
logging to log4j directly.  It is not harmful to include it anyway if you
are not sure.

Cheers,
John

On Thu Nov 06 2014 at 1:29:21 PM Bryan Baugher <bj...@gmail.com> wrote:

> Hi everyone,
>
> We recently switched to Storm 0.9.2 which moved to logback. We use the
> slf4j API and provide a log4j.properties in our topology jar but noticed
> the log levels set in the log4j.properties were not being honored. I read
> in the doc for log4j-over-slf4j[1] that 'Note that as a result of this
> migration, log4j configuration files will no longer be picked up.' So I
> converted my log4j.properties to logback.xml and re-deployed the topology
> but the log levels still don't seem to be honored. Does anyone have any
> suggestions on things I should try?
>
> [1] - http://www.slf4j.org/legacy.html
>

RE: Set default log levels in a topology jar

Posted by "Babu, Prashanth" <Pr...@nttdata.com>.
Hi,

If you are already using slf4j, the migration from log4j to logback should be seamless; as in just a drop-in replacement of log4j.properties for logback.xml.

Do you get any logs in your run?
If not, then probably you might want to confirm if logback.xml is indeed present in the classpath while execution.

If classpath is fine, then you might want to check if the logback.xml is proper.
You can try official translator [1] for migrating log4j.properties to logback.xml just to reconfirm your conversion was fine.

[1]: http://logback.qos.ch/translator

From: Bryan Baugher [mailto:bjbq4d@gmail.com]
Sent: 06 November 2014 21:28
To: user
Subject: Set default log levels in a topology jar

Hi everyone,

We recently switched to Storm 0.9.2 which moved to logback. We use the slf4j API and provide a log4j.properties in our topology jar but noticed the log levels set in the log4j.properties were not being honored. I read in the doc for log4j-over-slf4j[1] that 'Note that as a result of this migration, log4j configuration files will no longer be picked up.' So I converted my log4j.properties to logback.xml and re-deployed the topology but the log levels still don't seem to be honored. Does anyone have any suggestions on things I should try?

[1] - http://www.slf4j.org/legacy.html

______________________________________________________________________
Disclaimer: This email and any attachments are sent in strictest confidence
for the sole use of the addressee and may contain legally privileged,
confidential, and proprietary data. If you are not the intended recipient,
please advise the sender by replying promptly to this email and then delete
and destroy this email and any attachments without any further use, copying
or forwarding.

Re: Set default log levels in a topology jar

Posted by 임정택 <ka...@gmail.com>.
Sorry, it's logback/cluster.xml.

2014년 11월 7일 금요일, 임정택<ka...@gmail.com>님이 작성한 메시지:

> Storm uses its logback configuration, located on <storm dir>/cluster.
> AFAIK, you should modify it because slf4j picks it first so your log
> configuration file cannot bind.
> Hope this helps.
>
> 2014년 11월 7일 금요일, Bryan Baugher<bjbq4d@gmail.com
> <javascript:_e(%7B%7D,'cvml','bjbq4d@gmail.com');>>님이 작성한 메시지:
>
>> Hi everyone,
>>
>> We recently switched to Storm 0.9.2 which moved to logback. We use the
>> slf4j API and provide a log4j.properties in our topology jar but noticed
>> the log levels set in the log4j.properties were not being honored. I read
>> in the doc for log4j-over-slf4j[1] that 'Note that as a result of this
>> migration, log4j configuration files will no longer be picked up.' So I
>> converted my log4j.properties to logback.xml and re-deployed the topology
>> but the log levels still don't seem to be honored. Does anyone have any
>> suggestions on things I should try?
>>
>> [1] - http://www.slf4j.org/legacy.html
>>
>
>
> --
> Name : 임 정택
> Blog : http://www.heartsavior.net / http://dev.heartsavior.net
> Twitter : http://twitter.com/heartsavior
> LinkedIn : http://www.linkedin.com/in/heartsavior
>
>

-- 
Name : 임 정택
Blog : http://www.heartsavior.net / http://dev.heartsavior.net
Twitter : http://twitter.com/heartsavior
LinkedIn : http://www.linkedin.com/in/heartsavior

Re: Set default log levels in a topology jar

Posted by 임정택 <ka...@gmail.com>.
Storm uses its logback configuration, located on <storm dir>/cluster.
AFAIK, you should modify it because slf4j picks it first so your log
configuration file cannot bind.
Hope this helps.

2014년 11월 7일 금요일, Bryan Baugher<bj...@gmail.com>님이 작성한 메시지:

> Hi everyone,
>
> We recently switched to Storm 0.9.2 which moved to logback. We use the
> slf4j API and provide a log4j.properties in our topology jar but noticed
> the log levels set in the log4j.properties were not being honored. I read
> in the doc for log4j-over-slf4j[1] that 'Note that as a result of this
> migration, log4j configuration files will no longer be picked up.' So I
> converted my log4j.properties to logback.xml and re-deployed the topology
> but the log levels still don't seem to be honored. Does anyone have any
> suggestions on things I should try?
>
> [1] - http://www.slf4j.org/legacy.html
>


-- 
Name : 임 정택
Blog : http://www.heartsavior.net / http://dev.heartsavior.net
Twitter : http://twitter.com/heartsavior
LinkedIn : http://www.linkedin.com/in/heartsavior