You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by Bobby Evans <ev...@yahoo-inc.com.INVALID> on 2014/08/28 16:51:46 UTC
Re: Distinct log files or log statement tagging per topology
If you are running storm in distributed mode the each worker has a
different log file based off of the worker port. If you use the security
branch each log file also has the topology id in it too.
- Bobby
On 7/23/14, 3:18 PM, "Varun Vijayaraghavan" <va...@gmail.com> wrote:
>We have a storm cluster that's running three different topologies - and
>this number is expected increase for new features. Is there a way to
>separate the log statements for each topology code and maybe even keep it
>distinct from the log statements of the workers themselves? Either by
>having separate log files per topology or adding some kind of tagging to
>each log statement.. or any other better alternative.
>
>This would enable developers to easily see what's going on in the
>topologies that they wrote vs what's going on in other topologies and the
>storm cluster itself.
>
>Thanks!
>
>--
>- varun :)
Re: Distinct log files or log statement tagging per topology
Posted by Harsha <st...@harsha.io>.
Varun,
If your topologies using Logger to write debug or info you can
add logger to cluster.xml for example
<logger name="storm.starter.WordCountTopology" additivity="false">
<level value="INFO" />
<appender-ref ref="wordcount" />
</logger>
and use a custom appender
<appender name="wordcount"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${storm.log.dir}/wordcount.log</file>
<rollingPolicy
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${storm.log.dir}/wordcount.log.%i</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>9</maxIndex>
</rollingPolicy>
<triggeringPolicy
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>100MB</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n</pattern>
</encoder>
</appender>
I've tested the above with trunk and by adding Logger to
wordcounttopology.
-Harsha
On Thu, Aug 28, 2014, at 07:51 AM, Bobby Evans wrote:
> If you are running storm in distributed mode the each worker has a
> different log file based off of the worker port. If you use the security
> branch each log file also has the topology id in it too.
>
> - Bobby
>
> On 7/23/14, 3:18 PM, "Varun Vijayaraghavan" <va...@gmail.com> wrote:
>
> >We have a storm cluster that's running three different topologies - and
> >this number is expected increase for new features. Is there a way to
> >separate the log statements for each topology code and maybe even keep it
> >distinct from the log statements of the workers themselves? Either by
> >having separate log files per topology or adding some kind of tagging to
> >each log statement.. or any other better alternative.
> >
> >This would enable developers to easily see what's going on in the
> >topologies that they wrote vs what's going on in other topologies and the
> >storm cluster itself.
> >
> >Thanks!
> >
> >--
> >- varun :)
>