dev@grizzly.java.net

Re: How to make logger.fine(r, est) or logger.severe method to write messages to stdout?

From: ming qin <mingqin1_at_yahoo.com>
Date: Mon, 14 Sep 2009 10:59:17 -0700 (PDT)

Hi Oleksiy.Stashok

 Thanks for details on the email about configuring JVM command line args in project level inside NetBeans


Ming Qin
Cell Phone 858-353-2839

--- On Mon, 9/14/09, Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM> wrote:

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Subject: Re: How to make logger.fine(r, est) or logger.severe method to write messages to stdout?
To: dev_at_grizzly.dev.java.net
Date: Monday, September 14, 2009, 3:59 AM

Hi Ming Qin,
IMHO solution, which you propose might not be perfect, if you have several projects open, right? Because in that case Grizzly logging config will be applied to all of them.You can try to set logging following way:
In Grizzly project's "Project Properties" panel, click Actions, then use the action, where you'd like to apply logging settings and specify:"java.util.logging.config.file=/path/logging.properties" in the "Set properties :" area.
WBR,Alexey.

Hi:
For developers use NETBeans IDE. to accomplish logger configure through adding JVM command line argu as below 1) instruction:
     please see this link
     http://blogs.sun.com/charliebrown/entry/netbeans_ide_adding_changing_jvm

   here is what I add to netbeans.conf
  netbeans_default_options="-J-client -J-Xverify:none -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-Djava.util.logging.config.file=D:\\grizzly\\1_5_0\\logging.properties"

 
1) configprovide logger config file, when running a test. In the config file you can set logging level for logger and handler(s), like here [1].-Djava.util.logging.config.file=logging.properties
Ming Qin
Cell Phone 858-353-2839

--- On Thu, 8/27/09, Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM> wrote:

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Subject: Re: How to make logger.fine(r, est) or logger.severe method to write messages to stdout?
To: dev_at_grizzly.dev.java.net
Date: Thursday, August 27, 2009, 5:32 AM

Hi, Ming Qin,
you have two options:1) configprovide logger config file, when running a test. In the config file you can set logging level for logger and handler(s), like here [1].-Djava.util.logging.config.file=logging.properties
2) programmingadd custom logger Handler        logger.setLevel(Level.ALL);        final ConsoleHandler consoleHandler = new ConsoleHandler();        consoleHandler.setLevel(Level.ALL);        logger.addHandler(consoleHandler);
WBR,Alexey.
[1] http://www.exampledepot.com/egs/java.util.logging/Props.html
On Aug 27, 2009, at 4:48 , ming qin wrote:
Hi Everyone :

Running  com.sun.grizzly.DefaultControllerTest from version 1_9_17  in window xp cmd console and NetBean IDE. Hope com.sun.grizzly.Controller’s logger can output messages in autoConfigureCore () method to stdout.  By setting Controller’s logger level to ALL , this didn’t work.
 How do your guys make logger.fine(r, est) or logger.severe method to write messages to stdout?
 protected static Logger logger = Logger.getLogger("grizzly");// setting logger’s  level to LEVEL.ALL    static {      logger.setLevel(Level.ALL);    }Below is log message in autoConfigureCore. logger.fine("Controller auto-configured with 2 ReadController " +                        "based on underlying cores/processors, with a Thread Pool " +                        "of required size " + requiredThreadsCount ); Thanks in advance

Ming Qin
Cell Phone 858-353-2839