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] [Commented] (LOG4J2-1379) Documentation is subzero quality as far as yaml config files are concerned
Date Mon, 11 Jul 2016 08:15:11 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-1379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15370359#comment-15370359
] 

piero de salvia commented on LOG4J2-1379:
-----------------------------------------

{code}

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

{code}

{code}
Configuration:
  status: info

  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:
    Logger:
      - name: com.transdev.userservice
        additivity: false
        level: debug
        AppenderRef:
          - ref: RFile
    Root:
      level: info
      AppenderRef:
        ref: RFile
{code}



> Documentation is subzero quality as far as yaml config files are concerned
> --------------------------------------------------------------------------
>
>                 Key: LOG4J2-1379
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1379
>             Project: Log4j 2
>          Issue Type: Bug
>            Reporter: piero de salvia
>         Attachments: log4j2.xml, log4j2.yaml
>
>
> Documentation for yaml config files 
> http://logging.apache.org/log4j/2.x/manual/configuration.html
> fails to mention that this dependency must be added to actually use yaml config files:
> {code}
>         <dependency>
>             <groupId>com.fasterxml.jackson.dataformat</groupId>
>             <artifactId>jackson-dataformat-yaml</artifactId>
>             <version>2.7.4</version>
>         </dependency>
> {code}
> It also fails to mention that the equivalent basic config in yaml is the following:
> {code}
> Configuration:
>   status: warn
>   Appenders:
>     Console:
>       name: Console
>       target: SYSTEM_OUT
>       PatternLayout:
>         Pattern: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
>   Loggers:
>     Root:
>       level: info
>       AppenderRef:
>         ref: Console
> {code}
> At runtime, log4j2 "does not find" the config file (useless and misleading error message),
which in reality means it does not find the needed dependencies.
> To actually fix this, one must debug log4j2.
> So basically failing to mention something in documentation (effort = 0) causes users
to have to debug log4j (effort >> 0).
> This gives the whole project an amateurish and unkempt feel.



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