1 23 24 package com.sun.enterprise.server.logging; 25 26 import com.sun.logging.LogDomains; 27 import java.util.logging.ErrorManager ; 28 import java.util.logging.Level ; 29 import java.util.logging.Logger ; 30 31 37 public class DeploymentAuditLogHandler extends FileandSyslogHandler { 38 39 private static final String CONFIGURED_LEVEL_PROPERTY_NAME = "com.sun.aas.deployment.audit.level"; 40 private static final String CONFIGURED_LEVEL_PROPERTY_DEFAULT = "OFF"; 41 42 private static final DeploymentAuditLogHandler thisInstance = 43 new DeploymentAuditLogHandler( ); 44 45 private String logFileName = "deployment.log"; 46 47 public static synchronized DeploymentAuditLogHandler getInstance( ) { 48 return thisInstance; 49 } 50 51 55 protected DeploymentAuditLogHandler() { 56 } 57 58 protected AMXLoggingHook createAMXLoggingHook() { 59 return null; 60 } 61 62 protected String getLogFileName() { 63 return logFileName; 64 } 65 66 74 public static Level getConfiguredLevel() { 75 Level result = Level.OFF; 76 try { 77 result = Level.parse(System.getProperty(CONFIGURED_LEVEL_PROPERTY_NAME, CONFIGURED_LEVEL_PROPERTY_DEFAULT)); 78 } catch (Throwable thr) { 79 Logger logger = LogDomains.getLogger(LogDomains.DPL_LOGGER); 81 logger.log(Level.WARNING, thr.getLocalizedMessage(), thr); 82 } 83 return result; 84 } 85 } 86 | Popular Tags |