When creating appenders programatically you need to do something like
calling activateOptions(). You will probably find that using a config
file works much better.
On 10/11/07, Julio S. G. <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to create several appenders and unfortunately it's not working.
> To create the objects I'm using something like new
> DailyRollingFileAppender() with corrects parameters. Then I create the
> Logger using the appender name.
> Finally, when I use the Logger object to write, it doesn't work.
> I'll put the code here and if anyone could help me I really appreciate.
>
> Layout layout1 = new PatternLayout("%m%n");
> Layout layout2 = new PatternLayout("%m%n");
> DailyRollingFileAppender app1 = new
> DailyRollingFileAppender(layout1, "/file1.log", "'.'yyyyMMddHH");
> DailyRollingFileAppender app2 = new
> DailyRollingFileAppender(layout2, "/file2.log", "'.'yyyyMMddHH");
> app1.setThreshold(Level.DEBUG);
> app2.setThreshold(Level.DEBUG);
> app1.setName("APPENDER1");
> app2.setName("APPENDER2");
> Logger logger1 = Logger.getLogger(app1.getName());
> Logger logger2 = Logger.getLogger(app2.getName());
> logger1.info("TEST 1!!!");
> logger2.info("TEST 2!!!");
>
>
> Thanks,
>
> Julio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
James A. N. Stauffer http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]