I am creating a solution for my application log, which have various types of logging (user, application, etc...), wanted to save each type of log in a separate file.
This is possible with log4j or some other API? How could I do that?
If you deem interesting, I edit the question and put the codes, but I do not think it's worth, they are still very basic.
Thanks in advance.
Log4j provides for Loggers and Appenders. The way to do this is to have an Appender for each file you want. They set up an appropriate set of Loggers that point to the appropriate Appender(s). Loggers are usually set up using package names. If this will work for you, code in package x goes to file y, just do that. Otherwise, create Loggers per output file and have the code choose the appropriate logger. You can also have Loggers and send the information to multiple Appenders, so you can set these up as appropriate.
See korifey's post for an example of how to set this up.
Of cource, use different FileAppenders Example from internet:
Now you can log to admin.log
Logger.getLogger("com.vaannila.admin").log("To admin log")
and to report logLogger.getLogger("com.vaannila.report").log("To report log")