-
1. Re: Logging subsystem configuration
jamezp Apr 4, 2016 4:53 PM (in response to ravi21588)1 of 1 people found this helpfulI'm assuming here BIHLog is the name of the logger (category). What you'd need to do is create a new handler and add a logger named BIHLog that uses the new handler.
The following two CLI commands will add a new periodic-rotating-file-handler and all messages coming from a logger named BIHLog will be logged to this handler.
/subsystem=logging/periodic-rotating-file-handler=BIHLog:add(append=true, autoflush=true, file={relative-to=jboss.server.log.dir, path=bih.log}, suffix=".yyyy-MM-dd") /subsystem=logging/logger=BIHLog:add(handlers=[BIHLog], use-parent-handlers=false, level=INFO)
If you also want these logs to go to the server.log you can leave off the use-parent-handlers=false.
--
James R. Perkins
-
2. Re: Logging subsystem configuration
ravi21588 Apr 15, 2016 3:57 AM (in response to jamezp)Hi James,
Thanks a lot it is working fine from apache camel when i use log component.
Can you please tell me how to specify the logger name in java while using log4j.
Iam not able to find any method to set log name.
is the log4j logging and subsytem logging different?
-
3. Re: Logging subsystem configuration
jamezp Apr 15, 2016 11:19 AM (in response to ravi21588)Can you please tell me how to specify the logger name in java while using log4j.
I'm not sure I understand what you mean by this.
If you mean you want to define a logger in the logging subsystem the name would be the log4j category. That means what ever you used in Logger.getLogger("some.text"). If you used Logger.getLogger(com.example.Some.class) then the name would be "com.example.Some".
Assuming you don't have a log4j configuration file in your deployment the logging subsystem should work fine with log4j.
--
James R. Perkins