Note that there are some explanatory texts on larger screens.

plurals
  1. POLog4j custom configuration to separate log for each level - Playframework 1.2.5
    primarykey
    data
    text
    <p>I am trying to log some user data to log file whenever a request arrive with <code>log4j</code> in <strong>Play! Framework 1.2.5</strong>. I need to have 2 separated log file which will be used by different methods and classes. I would like to have my customized log files formatted as :</p> <blockquote> <p><strong>date with time - request running time and some string</strong> </p> </blockquote> <p><strong>First question</strong> : Could you please show me a helpful tutorial or an answer? Because whatever I have done so far was useless. </p> <p><strong>The second question</strong> : How can I configure log4j to log for each level such as only log <code>ERROR</code> message on one file, while only print <code>INFO</code> and <code>WARN</code> message on other file. My <code>log4j.properties</code> file is below. I know the previleges of message. But even I defined threshold why <code>ERROR</code>, <code>FATAL</code> or <code>WARN</code> messages also are written to info file? </p> <pre><code>log4j.rootLogger = ERROR, JUSTINFO, JUSTERROR log4j.logger = INFO log4j.appender.JUSTINFO = org.apache.log4j.RollingFileAppender log4j.appender.JUSTINFO.layout = org.apache.log4j.PatternLayout log4j.appender.JUSTINFO.layout.ConversionPattern = %d{dd/MM/yyyy HH:mm:ss} - [%X{processTime}] - %m%n log4j.appender.JUSTINFO.File = log/info.log log4j.appender.JUSTINFO.Threshold = INFO log4j.appender.JUSTERROR = org.apache.log4j.RollingFileAppender log4j.appender.JUSTERROR.layout = org.apache.log4j.PatternLayout log4j.appender.JUSTERROR.layout.ConversionPattern = %d{dd/MM/yyyy HH:mm:ss} - [%X{processTime}] - %m%n log4j.appender.JUSTERROR.File =log/warn.log log4j.appender.JUSTERROR.Threshold = ERROR </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload