Vic and Navjot, sorry I didn't respond sooner, I can't interact with
the mailing list from work.

I didn't really do anything special to get JDK1.4 logging to work
with Struts. From what I understand, commons-logging will "detect"
JDK1.4 logging, and use the logging.properties file for configuration.
As I'm sure your aware, you can find the logging.properties file under
jre/lib/.

For example, to kill all non-severe logging from struts and the validator,
I put the following lines in the logging.properties file.
org.apache.struts.level=SEVERE
org.apache.commons.validator.level=SEVERE

The servlet container we use takes standard out and writes it to a log file.
So I just log using the SimpleFormatter and the ConsoleHandler.

I don't use the LogManager at all. I use the logging package as is and it
works fine.

Maybe I'm doing something wrong that I'll run into later, but for now
I'm happy with the configuration.

I'm not sure I'm much help with this one.

robert

> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] Behalf Of Vic Cekvenich
> Sent: Wednesday, March 19, 2003 9:17 AM
> To: [EMAIL PROTECTED]
> Subject: Re: jdk14 log
>
>
>
>
> Navjot Singh wrote:
> > Hi Vic,
> >
> > Properties File Attached. Remember, the logging takes the formatter
> > specified in props if called from command prompt.
> > When i called from servlet, it take XMLFormatter by default.
> However, if you
> > give BasicFormatter, it picks up SimpleFormatter.
> >
> > It just refuses to pick my customer Formatter from Servlet.
> >
> > Use this to read file
> > =============
> >    LogManager logman = LogManager.getLogManager();
> >    FileInputStream in = new FileInputStream(filename);
>
> I am looking for something that would work in a Webapp, formbean, etc.
> Above would not open a file relative to WAR. You would have to use the
> servlet context, to be WAR relative.
> Anyway, no WAR sampleusing jdk1.4 out there, I went back to
> automatic log4j.
>
>
> .V
>
>
>
> >    logman.readConfiguration(in);
> >
> > Use this to test the config set
> > ====================
> >
> >   LogManager manager = LogManager.getLogManager();
> >   // Get all defined loggers
> >   Enumeration names = manager.getLoggerNames();
> >   while (names.hasMoreElements())
> >   {
> >        String loggername = (String)names.nextElement();
> >        Logger logger = manager.getLogger(loggername);
> >
> >        System.out.println("-----------------------");
> >        System.out.println("Logger name: >" + logger.getName() + "<");
> >        System.out.println("Logger level: " + logger.getLevel());
> >
> >        Handler[] hs = logger.getHandlers();
> >        for(int i=0;i<hs.length;i++)
> >        {
> >             System.out.println("\t" + hs[i].toString() + "#" +
> > hs[i].getFormatter() + "->" + hs[i].getEncoding());
> >        }
> >   }
> >
> > ----- Original Message -----
> > From: "Vic Cekvenich" <[EMAIL PROTECTED]>
> > To: "Navjot Singh" <[EMAIL PROTECTED]>
> > Sent: Tuesday, March 18, 2003 10:46 PM
> > Subject: jdk14 log
> >
> >
> > | Can you send me the properties files and the command that read it?
> > | I am trying to get JDK1.4 log to work in struts.
> > | thanks
> > | .V
> > |
> > |
> > |
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to