logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "piero de salvia (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LOG4J2-1393) No logging on file when using yaml config
Date Tue, 24 May 2016 13:03:12 GMT
piero de salvia created LOG4J2-1393:
---------------------------------------

             Summary: No logging on file when using yaml config 
                 Key: LOG4J2-1393
                 URL: https://issues.apache.org/jira/browse/LOG4J2-1393
             Project: Log4j 2
          Issue Type: Bug
    Affects Versions: 2.5
            Reporter: piero de salvia


When logging to console and file with a yaml configuration, console works, but log file is
empty.

Equivalent xml  config works fine.

XML:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="trace">
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
        </Console>
        <RollingFile name="RollingFile" fileName="/var/log/userservice/userservice-${date:yyyy-MM-dd}.log"
filePattern="/var/log/userservice/userservice-%d{yyyy-MM-dd}.log">
            <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
/>
            <Policies>
                <TimeBasedTriggeringPolicy />
            </Policies>
        </RollingFile>
    </Appenders>
    <Loggers>
        <root level="info">
            <appender-ref ref="RollingFile" level="info" />
            <appender-ref ref="Console" level="info" />
        </root>
    </Loggers>
</Configuration>

yaml:

Configuration:
  status: warn

  Appenders:
    Console:
      name: Console
      target: SYSTEM_OUT
      PatternLayout:
        Pattern: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
    RollingFile:
      name: RFile
      fileName: /var/log/userservice/userservice-${date:yyyy-MM-dd}.log
      filePattern: /var/log/userservice/userservice-%d{yyyy-MM-dd}.log
      PatternLayout:
        Pattern: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
      Policies:
        TimeBasedTriggeringPolicy: {}

  Loggers:
    Root:
      level: info
      AppenderRef:
        ref: RFile
      AppenderRef:
        ref: Console




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message