Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion How should logging levels work defined in logger.xml?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Markku Nikkanen  
View profile  
 More options Oct 18 2012, 6:59 am
From: Markku Nikkanen <markku.nikka...@gmail.com>
Date: Thu, 18 Oct 2012 03:59:02 -0700 (PDT)
Local: Thurs, Oct 18 2012 6:59 am
Subject: How should logging levels work defined in logger.xml?

Hello,

following tutorial lags of information. It does not explain well enough how
does loggers and logger's logging levels behave.

http://www.playframework.org/documentation/2.0.4/SettingsLogger

What I would expect to happen with following configurations is to have ONLY
following line to play.log.log file.

2012-10-18 13:13:50,164 - [ERROR] - from play in main
play error

Why I make this conclusion is based on following code block. Play logger is
set with logging level ERROR.

    <logger name="play" level="ERROR"/>

Only following line matches to above definition:

    Logger.of("play").error("play error");

This is how configurations are read:

java -Dlogger.file=logger.xml -cp
"/Users/mnikkane/repos/xxx/target/staged/*" play.core.server.NettyServer

------------------------------------------------------------

Following logging are set to file which inherits GlobalSettings

public void onStart(Application app) {

  Logger.trace("global trace");  

  Logger.debug("global debug");

  Logger.info("global info");

  Logger.warn("global warn");

  Logger.error("global error");

  Logger.of("application").trace("application trace");  

  Logger.of("application").debug("application debug");

  Logger.of("application").info("application info");

  Logger.of("application").warn("application warn");

  Logger.of("application").error("application error");

  Logger.of("play").trace("play trace");  

  Logger.of("play").debug("play debug");

  Logger.of("play").info("play info");

  Logger.of("play").warn("play warn");

  Logger.of("play").error("play error");

------------------------------------------------------------

I have removed application level logger from following configurations to
make it more readable, now:
<configuration>
    <appender name="FILE_DEBUG"
class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${application.home}/logs/play_log.log</file>
        <encoder>
            <pattern>%date - [%level] - from %logger in %thread
%n%message%n%xException%n</pattern>
        </encoder>
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>DEBUG</level>
        </filter>
        <rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">

<fileNamePattern>${application.home}/logs/play_log.%d{yyyy-MM-dd}.log</file NamePattern>
            <maxHistory>30</maxHistory>
        </rollingPolicy>
    </appender>

    <logger name="play" level="ERROR"/>

    <root level="WARN">
        <appender-ref ref="FILE_DEBUG"/>
    </root>
</configuration>

------------------------------------------------------------

Following Application.conf lines seems to have clear affect what logging
levels are actually logged, but I would like to handle all this through
logger.xml.

# Root logger:

#logger.root=INFO

# Logger used by the framework:

#logger.play=INFO

# Logger provided to your application:

#logger.application=WARN
------------------------------------------------------------

See how logs/play.log.log file contains lots of lines that should not be
there( or should they)?

2012-10-18 13:13:50,164 - [DEBUG] - from application in main
global debug

2012-10-18 13:13:50,164 - [INFO] - from application in main
global info

2012-10-18 13:13:50,164 - [WARN] - from application in main
global warn

2012-10-18 13:13:50,164 - [ERROR] - from application in main
global error

2012-10-18 13:13:50,164 - [DEBUG] - from application in main
application debug

2012-10-18 13:13:50,164 - [INFO] - from application in main
application info

2012-10-18 13:13:50,164 - [WARN] - from application in main
application warn

2012-10-18 13:13:50,164 - [ERROR] - from application in main
application error

2012-10-18 13:13:50,164 - [INFO] - from play in main
play info

2012-10-18 13:13:50,164 - [WARN] - from play in main
play warn

2012-10-18 13:13:50,164 - [ERROR] - from play in main
play error


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.