How to make log4j record to a file and print to console?

The problem is that your single \ should be \\. This is true in most properties files.

There are some issues with the \ in the file path that need to be fixed. The syntax is a bit cryptic but the way to log to multiple locations is to attach a named logging appender to the root logger. In this example this is: log4j.

RootLogger=DEBUG, LOG , stdout DEBUG is a logging level (threshold filter) to use for the root logger. LOG is the name of a logging appender stdout is the name of a second appender The logging appenders are specified by log4j.appender. {logging-appender-name}={some.

Log4j.appender. Class} log4j.appender. {logging-appender-name}.

{some-other-property}=... Where {logging-appender-name} is a name selected by yourself (in this case LOG and stdout) and {some. Log4j.appender. Class} is one of the many log4j logging appender classes such as DailyRollingFileAppender or ConsoleAppender.

I would have added: log4j.appender.LOG. Threshold=ALL I'm not sure what the default is.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions