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

Similar Messages

  • Formatting Negative Currency using the Java.Util Locale

    Hi....
    I am using the Locale file to get the currency code of a specified country. The code is given below.
    public String setCurrency(String _currency){
    Locale locale = new Locale("","PG");
    NumberFormat format = NumberFormat.getCurrencyInstance(locale);
    this.currency = format.format(Double.parseDouble(_currency));
    return currency;
    When i pass a negative value as the currency (-200) the string which returns will be as (PGK200) and when i pass a positive value it will be as PGK200......
    How can i format this so that when i pass a negative value, the returned String will be -PGK200 ??
    If there is anyone who knows how i can get this done please reply soon....
    Thanks in advance.
    Regards
    Nuwan.

    Check this out:import java.text.DecimalFormat;
    import java.text.NumberFormat;
    import java.util.Locale;
    public class CurrencyEg {
        private String currency;
        public String setCurrency(String _currency){
            Locale locale = new Locale("","PG");
            //NumberFormat format = NumberFormat.getCurrencyInstance(locale);
            DecimalFormat format = (DecimalFormat)NumberFormat.getCurrencyInstance(locale);
            format.setNegativePrefix("-PKG");
            format.setNegativeSuffix("");
            format.setPositivePrefix("PKG");
            format.setPositiveSuffix("");
            format.setMaximumFractionDigits(0);
            this.currency = format.format(Double.parseDouble(_currency));
            return currency;
        public static void main(String args[]) {
            CurrencyEg eg = new CurrencyEg();
            System.out.println("200 -> " + eg.setCurrency("200"));
            System.out.println("-200 -> " + eg.setCurrency("-200"));
    }I don't know how valid it is to cast and mess about with the format - but it gives exactly the output you were after:200 -> PKG200
    -200 -> -PKG200

  • Using the java.util.regex package

    I am trying to use the regex package to grep out portions of a string that match a regular expression. Some code from my class
        String fileList = "1_tmp.txt 2_tmp.txt 3_tmp.txt 1_inpt.txt 2_inpt.txt 3_inpt.txt 1_out.txt 2_out.txt 3_out.txt";
        String regex = "[0-9].*_out.txt"  ;
        Pattern pat = Pattern.compile(regex);
        Matcher m = pat.matcher(fileList);
        boolean succ = m.find();
        for (int i =0; i< m.groupCount(); i++) {
            System.out.println(m.group(i));
        }I was expecting to see
    1_out.txt
    2_out.txt
    3_out.txt
    This doesnt work this way, nothing gets printed out. Anybody has any idea what is wrong here?
    I am basically trying to get the same functionality as
    ls | grep "*_out.txt"
    Also is there any way to do a OR in the regular expression, like
    match [0-9]*_out.txt OR [0-9]*_out.txt
    Thanks
    -kn

    I don't see a difference in your OR, but look in the Pattern JavaDocs under logical operators.
    Second, groups are not appropriate in your situation. You have a single pattern which you wish to repeatedly find. Groups are used when you wish to pick out one subsection of a matched item. For example, a pattern dealing with a phone number might have three groups, the area code, the prefix, and the rest.
    Still, group 0 is by definition the entire matched item, so if your pattern was right, it should have worked.
    I think the critical piece is the ".*" section. * is a greedy marker and combined with the 'any chacter' marker will eat as many characters as it can. In this case, it's probably eating the rest of the string, which leaves nothing left for the "_out.txt" part of the pattern. Try using the *?, which is a reluctant marker and will basically look ahead in the pattern and eat the minimum number of characters it can.

  • 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.

  • 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

  • Preventing java.util.logging.Logger from writing to STD ERR.

    Hi!
    I'm currently writing a program which uses the java.util.logging package for logging. For some reason it writes ALL logging to std err (as well as to the designated (file) handlers). From what I gather, this is probably done via a ConsoleHandler, but I certainly haven't added any ConsoleHandler. I've also tried printing all registered handlers, which only returns one FileHandler (i.e. the one I added :)).
    The following is a simplification of the code I use:
    private static Logger log = Logger.getLogger("my.package");
        static{
             String logfile = "log.txt";          
              try{
                   FileHandler fh = new FileHandler(logfile);
                   fh.setFormatter(new Formatter() {
                        public String format( LogRecord record){
                             return record.getLevel()+ " " +new Date(record.getMillis()).toString() + ": " +record.getMessage()+ "\n";
                   System.out.println(log.getHandlers().length);
                   log.addHandler(fh);
                   log.setLevel(Level.ALL);
              }catch(IOException e){
                   Frontend.getInstance().displayWarning("Unable to write to log file at "+logfile);
        }Any help on this would be greatly appreciated!

    The speed and on-the-spotness of that reply totally blew me away. Thanks alot, buddy :).

  • Java.util.logging in 10.1.2

    Hi all. We have a j2ee application deployed on Oracle Application Server Containers for J2EE 10g (10.1.2.0.2) (build 050812.1879). We have used the java.util.logging package for our logging and are currently only able to view those with a level of either Level.SEVERE or Level.INFO. Any ideas how to enable the other levels will be appreciated. thanks

    See: http://www.oracle.com/technology/products/ias/toplink/doc/1013/main/_html/sescfg004.htm#BCGHIECC for an example how to use the logging.properties file to set the logging thresholds.
    Regards, Ronald

  • 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?

  • 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

  • Multi-locale support in java.util.logging?

    Can I use log (or logrb) methods in the java.util.logging API to localize my messages to a locale other than the default locale? From what I see in the jdk doc & src, it seems like this is not possible. This kind of multi-locale localization support is essential for server applications that talk to clients from different locales.

    Well, I've never done localization. In case you haven't seen it, here's some documentation from Logger, but that's all I can offer.
    Each Logger may have a ResourceBundle name associated with it. The named bundle will be used for localizing logging messages. If a Logger does not have its own ResourceBundle name, then it will inherit the ResourceBundle name from its parent, recursively up the tree.
    Most of the logger output methods take a "msg" argument. This msg argument may be either a raw value or a localization key. During formatting, if the logger has (or inherits) a localization ResourceBundle and if the ResourceBundle has a mapping for the msg string, then the msg string is replaced by the localized value. Otherwise the original msg string is used. Typically, formatters use java.text.MessageFormat style formatting to format parameters, so for example a format string "{0} {1}" would format two parameters as strings.
    When mapping ResourceBundle names to ResourceBundles, the Logger will first try to use the Thread's ContextClassLoader. If that is null it will try the SystemClassLoader instead. As a temporary transition feature in the initial implementation, if the Logger is unable to locate a ResourceBundle from the ContextClassLoader or SystemClassLoader the Logger will also search up the class stack and use successive calling ClassLoaders to try to locate a ResourceBundle. (This call stack search is to allow containers to transition to using ContextClassLoaders and is likely to be removed in future versions.)
    Formatting (including localization) is the responsibility of the output Handler, which will typically call a Formatter.

  • Where to find .jar files so I can implement import java.util.logging

    I'm trying to figure out how to take an application built for Websphere and port it to WebLogic. I've come across this blog entry http://blogs.sun.com/fkieviet/entry/using_java.util.logging_in_bea_weblogic and would like to try creating and using the startup class.
    I have not been able to find the correct jar files.
    import weblogic.common.T3ServicesDef;
    import weblogic.common.T3StartupDef;
    import weblogic.logging.LoggingHelper;
    In reading the documentation on using the NonCatalogLogger APIs at http://download.oracle.com/docs/cd/E12840_01/wls/docs103/i18n/writing.html I also see some code calling for the following imports
    import weblogic.jndi.Environment;
    import weblogic.logging.NonCatalogLogger;
    1. Does anyone know where I can grab these?
    2. There must be a strategy for finding these .jars that people use. If so, what is it?

    I thought I understood you, but the more I look at what you've set here, I'll just be honest and admit that the I don't know what you are saying here:
    'You should be able to add the "weblogic.jar" in the WebLogic distribution to your classpath.' - What doe this mean?
    1. Go to my xxxWeb app Dynamic Web Project and right-click and select Build Path / Configure Build Bath / Libraries - Select Add external JARS and navigate to the weblogic.jar
    2. Go to my xxxWeb app Dynamic Web Project and right-click and select Build Path / Configure Build Bath / Libraries - Select Add Library and try to go from there?
    3. Go to my xxxWeb app Dynamic Web Project and right-click and select Build Path / Configure Build Bath / Libraries - Select Add Variable and try to go from there?
    4. Go to my xxxWeb app Dynamic Web Project and right-click and select Build Path / Configure Build Bath and do something else?
    5. Something else?
    Also, I don't know what you mean here:
    'You don't need to (and you shouldn't) copy that jar file, just have it in your compilation classpath. It will be present automatically at runtime.'
    Sorry for being so simple here but I've been trouble shooting why I can't follow what look like pretty simple steps to implement over-riding the ApplicationLifecycleListener Class to use existing java.util.logging.Logger code by adding the following to the the weblogic-application.xml:
    <wls:listener>
         <wls:listener-class>com.qualcomm.weblogic.log.listener.UtilLogWrapper</wls:listener-class>
    </wls:listener>
    And including as a referenced jar file, a simple POJO class instance of com.qualcomm.weblogic.log.listener.UtilLogWrapper.
    My resrouces for this are:
    1. http://blogs.sun.com/fkieviet/entry/using_java.util.logging_in_bea_weblogic.
    2. http://www.oracle.com/technology/pub/articles/drolet-ant.html.
    Maybe my weblogic.jar is at the root of the problem.
    I hope you can 'dumb this down' for me with a simple explanation of steps to do what you outlined above.

  • 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.

  • 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.

  • 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.

Maybe you are looking for

  • Problem pasting text from Word into Mail

    When I compose text in Word and paste it into Mail, paragraphs are separated by spaces that weren't in the original Word document and I have to do a lot of work to get rid of them. If I compose or paste the text in TextEdit and then copy the message

  • Hebrew support in Adobe Muse

    Hi, im new to web design but im experienced with print. Im learing how to use Adobe Muse and like it. However, before starting my trial and subrscribing to the Creative Cloud just for Muse and later maybe business catalyst i have to make sure hebrew

  • Can you save to file and edit file?

    I have this problem with a dummy site i'm working on (for learning purposes) and i have 20 form text fields with an "add extra field" button. They are for entering sales of products, but the problem i'm having is that i use a DB, but come to realize

  • [MICRO] Zen Micro Media Explo

    When i try to transfer music files with Zen Micro Media Explorer (with the "import music" function) to my Zen Micro, it always says the tranfer is failed. But the player IS recognized by the program. Also i know it is not my usb-cable or the files i

  • Pse 12 installed, registered blocked at sign-in page

    PSE 12.  I installed PSE 12 registered it.  When I try to launch the appliacation a sign-in page appears.  Will not let me proceed.  Says computer not connected or clock wrong.  I have internet connected and clock displays correct local time.  How do