0 Replies Latest reply: Sep 13, 2012 3:50 AM by 934485 RSS

    java.util.logging.Logger not writing info level message in the console

    934485
      Hello,

      I have an webservice developed with Java that runs in a weblogic server. I am using the java.util.logging.Logger api for logging information.
      I want to have information logged in the console from the INFO level up. I have defined the following logging.properties file in the setDomainEnv.cmd from the weblogic domain:

      set JAVA_OPTIONS=%JAVA_OPTIONS% -Djava.util.logging.config.file=C:\oracle\Middleware3\jdk160_24\jre\lib\logging.properties

      and the logging.properties looks like this:

      ############################################################
      #      Default Logging Configuration File
      #
      # You can use a different file by specifying a filename
      # with the java.util.logging.config.file system property.
      # For example java -Djava.util.logging.config.file=myfile
      ############################################################

      ############################################################
      #      Global properties
      ############################################################

      # "handlers" specifies a comma separated list of log Handler
      # classes. These handlers will be installed during VM startup.
      # Note that these classes must be on the system classpath.
      # By default we only configure a ConsoleHandler, which will only
      # show messages at the INFO and above levels.
      handlers= java.util.logging.ConsoleHandler

      # To also add the FileHandler, use the following line instead.
      #handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler

      # Default global logging level.
      # This specifies which kinds of events are logged across
      # all loggers. For any given facility this global level
      # can be overriden by a facility specific level
      # Note that the ConsoleHandler also has a separate level
      # setting to limit messages printed to the console.
      .level= INFO

      ############################################################
      # Handler specific properties.
      # Describes specific configuration info for Handlers.
      ############################################################

      # default file output is in user's home directory.
      java.util.logging.FileHandler.pattern = %h/java%u.log
      java.util.logging.FileHandler.limit = 50000
      java.util.logging.FileHandler.count = 1
      java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter

      # Limit the message that are printed on the console to INFO and above.
      java.util.logging.ConsoleHandler.level = INFO
      java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter


      ############################################################
      # Facility specific properties.
      # Provides extra control for each logger.
      ############################################################

      # For example, set the com.xyz.foo logger to only log SEVERE
      # messages:
      com.xyz.foo.level = SEVERE

      But when I use logger.info("some string") in the code of my webservice, this doesn't show up in the console.
      Can you please help me with this? I do not want to use logger.setLevel() in the code of the application. I want the setting to be valid for all applications that are deployed on this server.
      I am using embedded weblogic 10.3.5 and have jdk=1.6.0_24 .

      Thanks in advance,
      Daniela.