Have you tried logback/cluster.xml ?
You can add your appenders.

 <appender name="name"
class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>/<path>/name.log</file>
    <rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <!-- daily rollover -->
      <fileNamePattern>/<path>/name.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
      <timeBasedFileNamingAndTriggeringPolicy
          class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
          <!-- or whenever the file size reaches 50MB -->
        <maxFileSize>100MB</maxFileSize>
      </timeBasedFileNamingAndTriggeringPolicy>
      <!-- keep 7 days' worth of history -->
      <maxHistory>7</maxHistory>
    </rollingPolicy>

    <encoder>
        <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %level %m%n</pattern>
    </encoder>
 </appender>

  <logger name="name" additivity="false" >
    <level value="DEBUG"/>
    <appender-ref ref="name"/>
 </logger>

Does this suit your use case ?


On Wed, Jun 7, 2017 at 3:44 PM, Anshul Mishra <[email protected]>
wrote:

>
> Hi team,
>
> I wanted to understand if there is a way to configure a Log4j.xml for
> Storm.
>
> Our use case is that we want to log all the messages(tuples)  that are
> being received from a Solace based queue before it is emitted by the spout
> and once when it is emitted.
>
> We are using log4j 1.x based Socket Appenders to write all logs at one
> port, from where it is picked by a small service that reads those logs and
> puts them in various files.
>
> The above scenario works fine for a local cluster but breaks when we run a
> distributed topology.
>
> My guess is that occurs due to Storm using its own configs which are in
> the log4j2  folder of the installed storm directory.
>
>
> Seeking your guidance,
> Anshul
>



-- 
Regards,
Amber Kulkarni

Reply via email to