Using java.util.logging Properly

Hello,
I have implemented java.util.logging in my application by creating a kind of "wrapper" class that I call for handling logging. It doesn't extend the logging classes, it just provides an object with helper methods that I can call when I want it.
public class LogCleanerLogger {
    private static final String cleanerLogfile = "logcleanerlog%g.txt";
    private static final String loggerName = "LogCleaner";
    private Logger cleanerLogger = null;
    public LogCleanerLogger() throws IOException{
        this.cleanerLogger = Logger.getLogger(getLoggerName());
        cleanerLogger.setUseParentHandlers(false);
        FileHandler logFile = new FileHandler(getCleanerLogfile(),10000,1, true);
        logFile.setFormatter(new SimpleFormatter());
        cleanerLogger.addHandler(logFile);
    public void writeLogInfoMessage(String message){
        cleanerLogger.info(message);
    public void writeLogWarningMessage(String message){
        cleanerLogger.warning(message);
    public void writeLogErrorMessage(String message){
        cleanerLogger.severe(message);
// getters and setters
} // end class    This all works quite happily and I can log any information I want. Except for one thing -- my log directory ends up with the log file (logcleanerlog0.txt) and a list of what appear to be temporary logs, e.g. logcleanerlog0.txt.1, logcleanerlog0.txt.2, and so on. Each increment of the number corresponds to a log file that has progressively less information in it that the previous one. At the top level, the unnumbered log, logcleanerlog0.txt, has all the logged information in it.
I cannot make out, from reading the API and other documentation, how I can get rid of these other files, which appear to me to be temporary files used in the construction of the top level file.
Can someone help me by explaining the mechanism for generating these files and either (a) how I can get rid of them altogether or (b) how I can arrange for them to be generated in a temp dir, while keeping the main log in the present directory (application root).
Or perhaps there is a "better way" (that is equally as easy, of course ;-).
Thanks.
mp

are you sure you cannot use the classes from a newer
version. You can put those classes in your own
directory. If there ar some other classes that need to
be from the newer version, you can include them, also
in your project. It is important that your project
directory to be placed in the classpath variable
before the jdk jars.
(this solution might not work)I doubt that is worth trying.
First, although it probably does not apply in this case, you are not allowed to distribute part of a JVM. So you could never use this solution in a commercial application.
Secondly the Java API does change. And every execution path that might use the changed code would have to be tested. That is going to take a lot of work. Keep in mind that the logging api uses java.lang.String and java.lang.String definitely changed in 1.4 and almost every class in the Java API uses it.

Similar Messages

  • Java.util.logging: write to one log file from many application (classes)

    I have a menuapp to launch many applications, all running in same JVM and i want to add logging information to them, using java.util.logging.
    Intention is to redirect the logginginfo to a specific file within the menuapp. Then i want all logging from all applications written in same file. Finally, if needed (but i don't think it is), i will include code to write logging to specific file per app (class). The latter is probably not neccessary because there are tools to analyse the logging-files and allow to select filters on specific classes only.
    The applications are in their own packages/jars and contain following logging-code:
            // Redirect error output
            try {
                myHandler = new FileHandler("myLogging.xml",1000000,2);
            } catch (IOException e) {
              System.out.println("Could not create file. Using the console handler");
            myLogger.addHandler(myHandler);
            myLogger.info("Our first logging message");
            myLogger.severe("Something terrible happened");
            ...When i launch the menuapplication, it writes info to "myLogging.xml.0"
    but when i launch an application, the app writes info to "myLogging.xml.0.1"
    I already tried to leave out the creation of a new Filehandler (try/catch block in code above) but it doesn't help.
    Is it possible to write loginfo to same specific file?

    You should open/close it somehow at every write from different processes.
    But I personally prefer different file names to your forced merging, though.

  • How to prevent java.util.logging from displaying pop-up dialog on SEVERE?

    Hi,
    I'm new to using java.util.logging. I notice that whenever I try to make a call to logger.SEVERE(msg) or logger.WARNING(msg), not only does it write the output to file (which I want), but it also pops up a dialog box displaying the exception. I don't want this pop up to appear. How do I prevent the logger from doing this?

    What are you talking about?
    Hello,
    In order to better assist you with your issue please provide us with a screenshot. If you need help to create a screenshot, please see [[How do I create a screenshot of my problem?]]
    Once you've done this, attach the saved screenshot file to your forum post by clicking the '''Browse...''' button below the ''Post your reply'' box. This will help us to visualize the problem.
    Thank you!

  • Enabling java.util.logging for Toplink

    JDeveloper 10.1.3.0.4 Build 3673 running Embedded OC4J (jdk1.5.0_02).
    I'm trying to get Toplink to log to a custom handler (a la java.util.logging) while running Embedded OC4J, but nothing I've tried works.
    If I use the java.util.logging.LogManager to loop through and print out all of the existing loggers, none of the 145 listed in the Embedded OC4J environment mention anything about toplink. So presumably Toplink is not running in "java" logging mode. I'm not using toplink workbench which seems to have a UI checkbox to enable java logging, and I haven't found a way to turn it on using JDeveloper. I've tried using the system property -Dtoplink.log.destination=JAVA (no effect) and adding my handler to j2ee-logging.xml (couldn't find my custom logging handler class, and won't help anyway if toplink isn't using java.util.logging), and various attempts at hacking sessions.xml with using log-type and java-log elements (I couldn't get them right--xml parse errors).
    What do I need to do to get Toplink to log to a custom handler?
    TIA,
    Clark

    Hi Clark,
    You can use either java or server log when running an application in OC4J.
    1 When you run a CMP application, use system property (e.g. Dtoplink.log.destination=JAVA)
    2 When you run a non CMP server application, use the logging tag in sessions.xml (e.g. <logging xsi:type="server-log"/>)
    You have the following options to get TopLink to log to a custom handler
    1 If you want to do the entire configuration from logging.properties, remove all handlers/loggers declarations from j2ee-logging.xml and in that case all configuration will be from logging.properties
    2 Use a combination of j2ee-logging.xml and logging.properties. You can define certain attributes in j2ee-logging.xml. They are "name", "class", "level", "errorManager", "filter", "formatter" and "encoding", and they correspond to the attributes of java.util.logging.Handler. Attributes in subclasses of Handler are not supported. All other properties for the handler are defined in logging.properties. j2ee-logging.xml is processed on top of logging.properties, which means j2ee-logging.xml takes the precedence for certain attributes/properties. Take FileHandler for an example,
    j2ee-logging.xml:
         <log_handlers>
         <log_handler name='my-handler' class='java.util.logging.FileHandler'
              formatter='java.util.logging.SimpleFormatter' level='INFO'/>
         </log_handlers>
    logging.properties:
         java.util.logging.FileHandler.pattern = %h/java%u.log
         java.util.logging.FileHandler.limit = 10000
         java.util.logging.FileHandler.count = 2
    If there are no properties defined in logging.properties, it will use its default values, which are documented in the FileHandler javadoc.
    Shannon

  • DateFormat in java.util.logging logging.properties - Please help

    Hello
    I have problem with properties file for my logger.
    Everything is ok except one thing: the date format.
    The question is how to say in my application.logging.properties, that the dates should be formated in particular way?
    In log4j it was (is) possible in way like this:
    log4j.appender.R.layout.ConversionPattern=$d{dd-MM-yyyy hh:mm:ss,SSS} %p [%t] %c - %m%nwhen I use java.util.logging I always get the dates in form like this:
    Jan 8, 2004 1:09:42 PMThe question is how to set date format pattern to for example: dd-MM-yyyy hh:mm:ss,SSS using properties file, to have the date in form like this:
    08-01-2004 13:09:42,768Thank You very much.
    Maciek

    Hi,
    did you find out how to do this?
    I'm after the exact same thing.

  • How is java.util.logging used to log to unix syslog?

    I'm trying to log out to syslog using the java.util.logging that is now in 1.4. I've read all I can find on this topic (not much) and have solicited the used of some syslog free ware (protomatter) but still can't get this to work. I feel like I'm missing something simple here, any help would be appreciated....
    Here is my latest attempt:
    import java.util.logging.*;
    import java.util.*;
    import java.io.*;
    import com.protomatter.syslog.SyslogHandler;
    public class SyslogTest
    public static void main(String argv[]){
    Logger logger2 = Logger.getLogger("local3");
    SyslogHandler ch = new SyslogHandler();
    ch.setLevel(Level.WARNING);
    logger2.addHandler(ch);
    logger2.warning("this is a log message");
    if (logger2.isLoggable(Level.WARNING)) {
    System.out.println("Is LOGGABLE");
    else {
    System.out.println("Is not loggable");
    When this is run nothing is printed to any of the local3 facilities. I've verified that syslog is running fine from the command line using unix logger, so the problem seems to be isolated to my java.
    Thanks.

    Hi,
    What is in your logging.properties file? Can you also include the contents of this file?
    Cheers,
    Craig.

  • Using the java.util.logging in JDK1.3

    I would like to use the java.util.logging classes of JDK1.4 in JDK1.3. So I tried creating a new jar with only the java.util.logging package, however, javac generates the error:
    >>>>>>
    bad class file: E:\ThinClient\Log\logging.jar(java/util/logging/Logger.class)
    class file has wrong version 48.0, should be 47.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    <<<<<<<
    I tried placing the jar both in classpath and bootclasspath during javac and still was not successful, is there any way of getting around this, other than re-implementing this or getting some third parties implementation such as Apache's log4j?

    check out Lumberjack in sourceForge

  • Java.util.logging - Problem with setting different Levels for each Handler

    Hello all,
    I am having issues setting up the java.util.logging system to use multiple handlers.
    I will paste the relevant code below, but basically I have 3 Handlers. One is a custom handler that opens a JOptionPane dialog with the specified error, the others are ConsoleHandler and FileHandler. I want Console and File to display ALL levels, and I want the custom handler to only display SEVERE levels.
    As it is now, all log levels are being displayed in the JOptionPane, and the Console is displaying duplicates.
    Here is the code that sets up the logger:
    logger = Logger.getLogger("lib.srr.applet");
    // I have tried both with and without the following statement          
    logger.setLevel(Level.ALL);
    // Log to file for all levels FINER and up
    FileHandler fh = new FileHandler("mylog.log");
    fh.setFormatter(new SimpleFormatter());
    fh.setLevel(Level.FINER);
    // Log to console for all levels FINER and up
    ConsoleHandler ch = new ConsoleHandler();
    ch.setLevel(Level.FINER);
    // Log SEVERE levels to the User, through a JOptionPane message dialog
    SRRUserAlertHandler uah = new SRRUserAlertHandler();
    uah.setLevel(Level.SEVERE);
    uah.setFormatter(new SRRUserAlertFormatter());
    // Add handlers
    logger.addHandler(fh);
    logger.addHandler(ch);
    logger.addHandler(uah);
    logger.info(fh.getLevel().toString() + " -- " + ch.getLevel().toString() + " -- " + uah.getLevel().toString());
    logger.info("Logger Initialized.");Both of those logger.info() calls displays to the SRRUserAlertHandler, despite the level being set to SEVERE.
    The getLevel calls displays the proper levels: "FINER -- FINER -- SEVERE"
    When I start up the applet, I get the following in the console:
    Apr 28, 2009 12:01:34 PM lib.srr.applet.SRR initLogger
    INFO: FINER -- FINER -- SEVERE
    Apr 28, 2009 12:01:34 PM lib.srr.applet.SRR initLogger
    INFO: FINER -- FINER -- SEVERE
    Apr 28, 2009 12:01:40 PM lib.srr.applet.SRR initLogger
    INFO: Logger Initialized.
    Apr 28, 2009 12:01:40 PM lib.srr.applet.SRR initLogger
    INFO: Logger Initialized.
    Apr 28, 2009 12:01:41 PM lib.srr.applet.SRR init
    INFO: Preparing Helper Files.
    Apr 28, 2009 12:01:41 PM lib.srr.applet.SRR init
    INFO: Preparing Helper Files.
    Apr 28, 2009 12:01:42 PM lib.srr.applet.SRR init
    INFO: Getting PC Name.
    Apr 28, 2009 12:01:42 PM lib.srr.applet.SRR init
    INFO: Getting PC Name.
    Apr 28, 2009 12:01:42 PM lib.srr.applet.SRR init
    INFO: Finished Initialization.
    Apr 28, 2009 12:01:42 PM lib.srr.applet.SRR init
    INFO: Finished Initialization.Notice they all display twice. Each of those are also being displayed to the user through the JOptionPane dialogs.
    Any ideas how I can properly set this up to send ONLY SEVERE to the user, and FINER and up to the File/Console?
    Thanks!
    Edit:
    Just in case, here is the code for my SRRUserAlertHandler:
    public class SRRUserAlertHandler extends Handler {
         public void close() throws SecurityException {
         public void flush() {
         public void publish(LogRecord arg0) {
              JOptionPane.showMessageDialog(null, arg0.getMessage());
    }Edited by: compbry15 on Apr 28, 2009 9:44 AM

    For now I have fixed the issue of setLevel not working by making a Filter class:
    public class SRRUserAlertFilter implements Filter {
         public boolean isLoggable(LogRecord arg0) {
              if (arg0.getLevel().intValue() >= Level.WARNING.intValue()) {
                   System.err.println(arg0.getLevel().intValue() + " -- " + Level.WARNING.intValue());
                   return true;
              return false;
    }My new SRRUserAlertHandler goes like this now:
    public class SRRUserAlertHandler extends Handler {
         public void close() throws SecurityException {
         public void flush() {
         public void publish(LogRecord arg0) {
              Filter theFilter = this.getFilter();
              if (theFilter.isLoggable(arg0))
                   JOptionPane.showMessageDialog(null, arg0.getMessage());
    }This is ugly as sin .. but I cannot be required to change an external config file when this is going in an applet.
    After much searching around, this logging api is quite annoying at times. I have seen numerous other people run into problems with it not logging specific levels, or logging too many levels, etc. A developer should be able to complete configure the system without having to modify external config files.
    Does anyone else have another solution?

  • Unable to capture messages from java.util.logging

    I have a class called (Caller.java) which invokes a method called foo from another java class(Util.java) using reflection API.Now this method foo logs messages using Java's logger.My requirement is to call foo for 3 times from Caller and capture/redirect the log messages into 3 log files.
    But only the first log file is capturing the log messages(from logger) and other two are not ?
    Plz suggest if I am doing somethin wrong here ?
    Caller.java
    package project2;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.PrintStream;
    import java.lang.reflect.Method;
    public class Caller {
        public Caller() {
        public static void main(String[] args) throws Exception {
            Caller caller = new Caller();
            for (int i = 0 ;i<3 ;i++ )  {
                caller.createLogStream(i);
                System.setOut(caller.getPs());
                System.setErr(caller.getPs());
                /*****************Invoking Util.java*****************************/
                Class clas = Class.forName("project2.Util");
                Method m = clas.getMethod("foo",null);
                Object obj =clas.newInstance();
                m.invoke(obj,null);
        public void createLogStream(int i) throws FileNotFoundException {
            ps = new PrintStream(new File(System.getenv("HOME")+File.separator+"MyLog"+i+".log"));
        public void closeLogStream(){
            ps.close();
            ps = null;
        private PrintStream ps = null;
        public PrintStream getPs() {
            return ps;
    } Util.java
    package project2;
    import java.util.logging.Logger;
    public class Util {
        Logger logger = null;
        public Util() {
            logger = Logger.getLogger(this.getClass().getName());
        public void foo(){
            System.out.println("Hello out stream");
            System.err.println("Hello error stream");
            logger.info("This is an information");
            logger.warning("This is a warning message");
            logger.severe("This is fatal!! ");
    }First Log file MyLog0.log:
    Hello out stream
    Hello error stream
    Feb 16, 2009 7:55:55 PM project2.Util foo
    INFO: This is an information
    Feb 16, 2009 7:55:55 PM project2.Util foo
    WARNING: This is a warning message
    Feb 16, 2009 7:55:55 PM project2.Util foo
    SEVERE: This is fatal!!
    Feb 16, 2009 7:55:55 PM project2.Util foo
    INFO: This is an information
    Feb 16, 2009 7:55:55 PM project2.Util foo
    WARNING: This is a warning message
    Feb 16, 2009 7:55:55 PM project2.Util foo
    SEVERE: This is fatal!!
    Feb 16, 2009 7:55:55 PM project2.Util foo
    INFO: This is an information
    Feb 16, 2009 7:55:55 PM project2.Util foo
    WARNING: This is a warning message
    Feb 16, 2009 7:55:55 PM project2.Util foo
    SEVERE: This is fatal!! Other 2 log files have only this much
    Hello out stream
    Hello error stream

    A stale Connection Factory or Connection Handle may be used in SOA 11g
    Regards,
    Anuj

  • Doubt in java.util.logging

    Hi,
    I have doubt in logging api provided in java 1.4.
    I have a simple program to get the logger and output log into it.
    This is how the program looks.
    LogTest.java
    import java.util.logging.*;
    import java.util.*;
    public class LogTest {
    public static void main(String args[]) {
         LogManager manager = LogManager.getLogManager();
         Logger l = manager.getLogger("global");
         System.out.println(l);
         l.severe("Test");
         System.out.println(manager.getLogger("ivy"));
         System.out.println(manager.getLogger("test"));
    I able to get the instance of the global logger, but im not able to get instance of other logger. I getting null for all the other logger
    test.properites
    =================
    handlers = java.util.logging.ConsoleHandler
    java.util.logging.ConsoleHandler.level=INFO
    java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
    ivy.level = INFO
    .ivy.level = INFO
    =================
    Compilation Command
    java -Djava.util.logging.config.file=C:\WorkSpace\test.properties LogTest Output:
    java.util.logging.Logger@13f5d07
    Jan 25, 2006 7:19:24 PM LogTest main
    SEVERE: Test
    null
    null
    I also tried the same with no config properties, Still im getting the null for logger.
    Can I know is there anything that im missing. Is there any property that must be set or do i hav set some config properties.
    Thanks,
    Siva

    Well, basically that's part of the formatdefinition
    that Properties uses. If you don't do it, then you
    aren't really using Properties format and you'llhave
    to do your own IO.Thanks for the reply. Is there anyother api or class
    that can be used to resolve my problem.What is the problem? A character is escaped, but you will get : when you read the value. You don't have a problem as long as all reading / writing is done through that class.

  • Getting no output from java.util.logging.FileHandler

    I am new to Java as is the company I work for, but we have just landed a contract that specifies J2EE as the platform, so here we are. :-) Please bear with me.
    I have been charged with determining our logging architecture and it looks like what is available in java.util.logging will do well (though we may use log4j). However, at this point I am just trying to get anything to work and not having much luck.
    We are using JSF on the front end and I have created a very simple JSF page to test logging. The relevant code is below and I hope will be self explanatory: This code is not meant to be efficient or anything. It is just a proof of concept.
        public String button1_action() {
            // User event code here...
            try {
                Logger l = java.util.logging.Logger.getLogger(Page1.class.getName());
                l.entering(Page1.class.getName(), "button1_action");
                l.info(this.textField1.getValue().toString());
                l.exiting(Page1.class.getName(), "button1_action");
                java.util.logging.Handler h = l.getHandlers()[0];
                h.flush();
            catch(Exception ex) {
                //I have tested this and we aren?t catching any errors.
                System.err.println(ex);
            return "";
        }My logger.properties files looks like this:
    handlers= java.util.logging.FileHandler
    .level= FINEST
    java.util.logging.FileHandler.pattern = c:/sun/logs/test-%u.log
    java.util.logging.FileHandler.limit = 50000
    java.util.logging.FileHandler.count = 1
    java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatterI have developed and tested this in Sun Studio Creator 2004Q2 What is happening is that I am getting three log files in c:/sun/logs
    test-0.log, test-1.log and test-2.log. The first two contain output from various sun components. (sun.rmi.transport for example). The third log remains empty. (zero length)
    I have also deployed the test app to a tomcat 5.0.28 server and get similar results. The only difference is I get only one two log files and the second one remains empty.
    Any assistance or suggestions as to what direction I should be taking would be appreciated.
    --Ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Do not use default logger as getLoggers[0] , but use your java.util.Logger.FileHandler and add filehandler object to log your fButtonActions and you do not need to mess with logger.properties too.

  • Java.util.logging.XMLFormatter - need advise

    Hi all,
    I have this class which suppose to write some message into the custom log file (in XML). Problem is, after the first time of writing it into the same file, it will append additional XML header :
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE log SYSTEM "logger.dtd">
    Worse, it will always append below.
    For example, the original XML file contains:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE log SYSTEM "logger.dtd">
    <log>
    <record>
      <date>2010-10-20T18:18:33</date>
      <millis>1287569913671</millis>
      <sequence>0</sequence>
      <logger>atm.controller.Log_Controller</logger>
      <level>INFO</level>
      <class>atm.controller.Log_Controller</class>
      <method>writeInfoLog</method>
      <thread>10</thread>
      <message>message inside thia standard data</message>
    </record>
    </log>when I write additional message into the same file using logger.info("some message"); on the second rounds, it will append additional XML header* info and become like this:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE log SYSTEM "logger.dtd">
    <log>
    <record>
      <date>2010-10-20T18:18:33</date>
      <millis>1287569913671</millis>
      <sequence>0</sequence>
      <logger>atm.controller.Log_Controller</logger>
      <level>INFO</level>
      <class>atm.controller.Log_Controller</class>
      <method>writeInfoLog</method>
      <thread>10</thread>
      <message>message inside thia standard data</message>
    </record>
    </log>
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!DOCTYPE log SYSTEM "logger.dtd">
    <log>
    <record>
      <date>2010-10-20T18:21:25</date>
      <millis>1287570085050</millis>
      <sequence>0</sequence>
      <logger>atm.controller.Log_Controller</logger>
      <level>INFO</level>
      <class>atm.controller.Log_Controller</class>
      <method>writeInfoLog</method>
      <thread>10</thread>
      <message>message inside thia standard data</message>
    </record>
    </log>--------------------------------------------------
    Below is the code.
    import java.io.IOException;
    import java.util.logging.FileHandler;
    import java.util.logging.Logger;
    import java.util.logging.XMLFormatter;
    public class Log_Controller
        private static Logger logger = Logger.getLogger( Log_Controller.class.getName() );
        private boolean allowAppend = true;
        public Log_Controller()
            try
                XMLFormatter formatterTxt = new XMLFormatter();
                FileHandler fileTxt = new FileHandler( "test.xml", allowAppend );
                fileTxt.setFormatter( formatterTxt );
                logger.addHandler( fileTxt );
            catch ( IOException ioe )
                ioe.printStackTrace();
        public void writeInfoLog( String message )
            logger.info("message inside thia standard data");  //THIS IS THE PART WHERE IT WRITE SOME MESSAGE INTO THE FILE
    //        logger.info( message );
    }This is something new to me, appreciate if someone can point me what the mistake that I have done.
    Thanks thanks.
    Edited by: 803699 on 20-Oct-2010 04:15
    Edited by: 803699 on 20-Oct-2010 08:45

    you cannot append to an xml file using the standard formatter because it makes the log file a "complete xml document" (header and root wrapper tags). if you want to be able to append to an existing xml log file, you will need to roll your own formatter.

  • Creating a new Handler (java.util.logging API)

    Hi,
    I'm developping a new Handler (extending the java.util.logging.StreamHandler) and I need to get some initialisation properties from the LogManager. I was taking example from the existing Handlers (SocketHandler, FileHandler...) and wanted to use the LogManager.getLevelProperty, getFilterProperty and so on). Unfortunately these methods are not public.
    Is there any good reason for that ? As we are still dealing with a beta version, can't we have them public (same old Open Source problem).
    Antonio

    I am in a similar situation and agree completely with the above comments. Using the LogManager getProperty() is incredibly cumbersome.
    Ciao Ric

  • OracleLog.properties for java.util.logging

    In the Oracle JDBC FAQ the answer to the question "How do I configure java.util.logging to get useful trace output from Oracle JDBC?" <http://otn.oracle.com/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#36_03> mentions the file "OracleLog.properties" provided in the "demo.zip" file.
    I cannot find the file "OracleLog.properties" anywhere?
    Any suggestions?
    Kindest Regards,
    Gerhard Hofmann

    It seems a logger instance HAS been created for my Test class, I've added the lines below. Though it didn't appear in the logger names enumeration.
    java.util.logging.Logger logger = java.util.logging.Logger.getLogger(name);
    System.out.println(logger.getName()+"="+logger.getLevel().getName());
    logger.severe("severe");
    logger.warning("warning");
    logger.info("info");
    logger.config("config");
    logger.fine("fine");
    logger.finer("finer");
    logger.finest("finest");Output:Test=FINEST
    6/10/2003 16:00:01 Test <init>
    SEVERE: severe
    6/10/2003 16:00:01 Test <init>
    WARNING: warning
    6/10/2003 16:00:01 Test <init>
    INFO: infoObservations:
    1) Despite my Test class having the FINEST log level, the default ConsoleHandler had log level of INFO, and hence only up to INFO logged.

  • Help with java.util.logging SocketHandler - Simple TCP Server

    I have a simple TCP serverString clientSentence;
                 ServerSocket welcomeSocket = new ServerSocket(5050);
                 while(true) {
                    Socket connectionSocket = welcomeSocket.accept();
                    BufferedReader inFromClient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream()));
                    while ((clientSentence = inFromClient.readLine()) != null) {
                         System.out.println("Received: " + clientSentence);
                 }And I have a java.util.logging logger using a SocketHandler. I'm just calling logger.log("my message"); I get the expected result to System.out: "my message". But when I go on to call again logger.log("my next message") I get both messages in queue: "my message" and "my next message" on the next line. So, I get from these two calls to logger.log() the following result in System.out
    my message
    my message
    my next message...whereas I expected
    my message
    my next messageWhy is "my message" being saved even after being passed through the TCP connection to the server? I tried handler.flush() but that doesn't help. Pretty sure the problem isn't at the server end because when I create two loggers with their own SocketHandlers the server doesn't double up on their messages. (In other words, if I let one logger say simply "my message" and the second logger say "my next message" I get the expected output. It's like each logger needs to be flushed after sending to the server.
    Any advice appreciated.

    Yes, I was just rereading your post and it's apparent that you were suspecting the client code. Your posting only the server led me to believe that you were focusing on that and I kind of skipped over the last part.
    So to answer your question, yes, the server code looks okay. And you were suspecting the client anyway, so problem solved.

Maybe you are looking for

  • Payments based on inventory type, item category...

    Hi, I am trying to develop a report to show unrecorded liabilities - basically, I need to find out if there are payments/accounting documents/invoice number existing in the system, that has no connecting documents in purchase or sales side. I am able

  • How do I transfer a slideshow from my iMac to my iPad.  Can I use icloud or iMovie?

    i Created a slideshow with music on my iMac.  How can I transfer it to my iPad.  Can I use iCloud or IMovie.

  • Simulate Inbound Calls with the IC WebClient

    Dear experts I'd like to configure to configure SAP Contact Center Simulator as communication management system (CMS) for IC WebClient Scenarios. I did the following steps: - Define CMS profile (SPRO) - Define CMS system (T-Code CRMM_IC_MCM_CCADM) -

  • RAC Node 2 is down !!

    When we want to startup node2 of our RAC installation we see the below error on alert.log file; Errors in file /u01/oracle/product/10.2.0/db/rdbms/log/uret2_ora_8166.trc: ORA-27504: IPC error creating OSD context ORA-27300: OS system dependent operat

  • Shared Session

    Hello we need a session-store (maintaining state) which is shared between several WebDynpros. The WebDynpros are embedded into the Portal as iViews, any hint how to get such a shared session-store? Thanks! Kai