0

i want to know is how to log into differrent files. Here is the scenario. i have five java programs and in each program i have to create logging functionality. But each java program has to have its own log file , i mean separate log files. ex: l1.txt,l2.txt,l3.txt,l4.txt and l5.txt are the five log files. From the log4j tutorials i see that i can create a logger for a single file. but i dont find how to create for many files and how to allow programs to access a particular appender to log into the corressponding file. i am looking for such a program to implement.

manick
  • 56
  • 4

1 Answers1

0
  1. If the list of classes is known then, create a logger with a separate name in each class, and in the log4j / JDK logger config, create separate files for each logger name.

  2. Alternatively, you can try creating your own LogHandler as well.

Harsha R
  • 707
  • 6
  • 12