what is the command to write your logging information into a file?



what is the command to write your logging information into a file?..

Answer / Rishav Kumar

In Log4j, you can set the 'log4j.appender.console' property in your configuration file or code to use FileAppender instead of ConsoleAppender if you want to write log messages to a file. For example: `<appender name="File" class="org.apache.log4j.RollingFileAppender">`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apache Log4j Interview Questions

what are the logging methods provided by logger class?

1 Answers  


what are the other support objects in Log4j?

1 Answers  


Explain why to use Apache Log4j?

1 Answers  


what does WARN and TRACE level indicates in log4j?

1 Answers  


why do you get multiple copies of the message in log file sometime?

1 Answers  


what is Log4j?

1 Answers  


what is layouts in log4j?

1 Answers  


what are the different types of Appenders?

1 Answers  


what are the system properties checked by log4j?

1 Answers  


what is the best way to migrate from java.util logging to log4j?

1 Answers  


Explain whether log4j is a thread safe?

1 Answers  


what are the format characters used in log4j?

1 Answers  


Categories