Package org.apache.openjpa.lib.log
Class LogFactoryImpl
java.lang.Object
org.apache.openjpa.lib.log.LogFactoryImpl
- All Implemented Interfaces:
Configurable,GenericConfigurable,LogFactory
Default
LogFactory implementation. For ease of automatic
configuration, this implementation keys on only the last dot-separated
token of the log channel name.- Author:
- Patrick Linskey
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked upon completion of bean property configuration for this object.shortThe default level for unconfigured log channels.A string to prefix all log messages with.static shortReturns a symbolic constant for the specified string level.static StringgetLevelName(short level) Returns a string representation of the specified log level constant.Return a log for the given channel name.The stream to write to.protected LogFactoryImpl.LogImplCreate a new log.voidInvoked prior to setting bean properties.voidsetDefaultLevel(short level) The default level for unconfigured log channels.voidsetDefaultLevel(String level) The string name of the default level for unconfigured log channels; used for automatic configuration.voidA string to prefix all log messages with.voidThe stream to write to.voidPerform any generic configuration based on the data inopts.voidsetStream(PrintStream stream) The stream to write to.voidInvoked before bean property configuration is begun on this object.
-
Field Details
-
TRACE_STR
-
INFO_STR
-
WARN_STR
-
ERROR_STR
-
FATAL_STR
-
STDOUT
- See Also:
-
STDERR
- See Also:
-
initializationMillis
protected final long initializationMillisThe time at which this factory was initialized.
-
-
Constructor Details
-
LogFactoryImpl
public LogFactoryImpl()
-
-
Method Details
-
getLog
Description copied from interface:LogFactoryReturn a log for the given channel name.- Specified by:
getLogin interfaceLogFactory
-
newLogImpl
Create a new log. The log will be cached. -
setDefaultLevel
The string name of the default level for unconfigured log channels; used for automatic configuration. -
getDefaultLevel
public short getDefaultLevel()The default level for unconfigured log channels. -
setDefaultLevel
public void setDefaultLevel(short level) The default level for unconfigured log channels. -
setDiagnosticContext
A string to prefix all log messages with. Set tonullto use the configuration's Id property setting. -
getDiagnosticContext
A string to prefix all log messages with. Set tonullto use the configuration's Id property setting. -
setFile
The stream to write to. Recognized values are:stdoutandstderr. Any other value will be considered a file name. -
getStream
The stream to write to. -
setStream
The stream to write to. -
getLevelName
Returns a string representation of the specified log level constant. -
getLevel
Returns a symbolic constant for the specified string level. -
setConfiguration
Description copied from interface:ConfigurableInvoked prior to setting bean properties.- Specified by:
setConfigurationin interfaceConfigurable
-
startConfiguration
public void startConfiguration()Description copied from interface:ConfigurableInvoked before bean property configuration is begun on this object.- Specified by:
startConfigurationin interfaceConfigurable
-
endConfiguration
public void endConfiguration()Description copied from interface:ConfigurableInvoked upon completion of bean property configuration for this object.- Specified by:
endConfigurationin interfaceConfigurable
-
setInto
Description copied from interface:GenericConfigurablePerform any generic configuration based on the data inopts. This method should remove any values inoptsthat have been successfully processed; if any values remain inoptsafter this method is executed, an exception will be thrown identifying those key-value pairs as invalid.- Specified by:
setIntoin interfaceGenericConfigurable
-