Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
In Reply to Brian Krieger:
Brian,
I use java.util.logging, and when I don't want XML I just create plain text logs using the SimpleFormatter...
.
.
.
FileHandler fh = null;
Formatter formatter = new SimpleFormatter();
// Formatter formatter = new XMLFormatter();File logsDir = new File( getLogsDirPath() );
if (logsDir.exists() == false) {
logsDir.mkdirs();
}
fh = new FileHandler( getLogFile().getAbsolutePath() );
fh.setFormatter(formatter);
logger.addHandler(fh);
logger.setLevel(Level.ALL);logger.config("Logging started.");
logger.config("Java Runtime: " + System.getProperty("java.home"));
logger.config("ProE Build Code " + pfcGlobal.GetProEBuildCode ());.
.
.
-Gary_______________________
Gary Hoffman
PLM/CAD Application Support and DevelopmentSolar Turbines Inc
9280 Sky Park Court
Mail Zone: SP3H
San Diego, CA 92123-4302-
858.694.6961 Ph
858.694.6733 Fax
So, just a query of sorts. What kind of logging does anyone out there use? I know, all of y'all's programs work perfectly the first time out no sweat. I still struggle occasionally...........ha ha. So I used to use an open print stream and I want to move to a more sophisticated/native logger now that we're rewriting stuff for Creo 2. My gut is to use the java util logger as there are no additional jars required. My challenge is the xml format which seems a bit verbose. I like to think that the info would be useful, so I'll just deal with it.
All that said, the idea was to collect what anyone else is using. Thoughts on what y'all use?
Brian Krieger
I write my tools in a netbeans rcp so they are plugins and use the netbeans native logger based on log4j.