users@glassfish.java.net

Re: Writing to the log file

From: mrichngc <milton.richardson2_at_ngc.com>
Date: Thu, 3 Feb 2011 20:48:35 -0800 (PST)

I am trying to write to the server.log file and tried this. For some reason
it's not working and it's driving me nuts. I've created an EJB and that
logs system.out.println messages that I have in the code. but when I deploy
my other application, I get nothing.

I even tried to just write an app with 1 class(main) and deploy that with
nothing but a log message and that doesn't work. Here is the code for my
main class:


package com.base.core;

import java.util.logging.Logger;

public class tstMain {

        /**
         * @param args
         */
        public static void main(String[] args) {
                
                Logger logger = Logger.getLogger("tstMain");
logger.info("This is a log message from the application!");
        }

On the app server under Application Server, Logging, I added the package
listed above (com.base.core.tstMain) and for the value I put "INFO"

I get no log message....PLEASE HELP I AM AT MY WITS END! ! LOL

}
glassfish-2 wrote:
>
> On the GUI, under the Application Server, there's a logging tab. There you
> can set the log levels for the internal GF components.
>
> If you want to have your own applications write to the log, you can simply
> use java.util.logging.
>
> So:
>
> [code]
>
> import java.util.logging.Logger;
>
> private Logger log = Logger.getLogger(YourClass.class.getName());
>
> log.info("My log message.");
> [/code]
>
> By default, only WARNING and SEVERE are written to the log. If you want a
> different log level, you can go to the Logging panel, and at the bottom
> are Properties.
>
> There you can add:
>
> com.your.package.YourClass and INFO in the second box.
>
> Then your logs will show in the log file and the log viewer.
> [Message sent by forum member 'whartung' (whartung)]
>
> http://forums.java.net/jive/thread.jspa?messageID=321949
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>

-- 
View this message in context: http://old.nabble.com/Writing-to-the-log-file-tp21051282p30841907.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.