log4j configuration at runtime

A

ahmet

i have 3 appender and one logger defined in the xml file.
<appender name="EMAIL" ...
<appender name="FILE" ...
<appender name="CONSOLE" ...

<logger name="myLogger">
<appender-ref ref="EMAIL" />
<appender-ref ref="FILE" />
</logger>

what i am trying to do is
removing EMAIL appender and adding COSOLE appender to the myLogger at
runtime.
 
A

ahmet

public static Logger logger = Logger.getLogger("myLogger");
logger.removeAppender()
logger.addAppender()

I know the above functions used for adding and removing appenders.
but both of these functions take Appender as an input.
I can restate my question in the first message like
how can get the appenders that are defined in the conf. file but donot
belong to any loggers.




ahmet yazdi:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,600
Members
45,179
Latest member
pkhumanis73
Top