Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.openjpa.lib.log
Class LogFactoryImpl

    java.lang.Object
      org.apache.openjpa.lib.log.LogFactoryImpl

All Implemented Interfaces:
  GenericConfigurable, LogFactory

    public class LogFactoryImpl

extends Object
implements LogFactory, GenericConfigurable

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
`class` | `LogFactoryImpl.LogImpl` A simple implementation of the `Log` interface.

Field Summary
`static String` | `ERROR_STR`
`static String` | `FATAL_STR`
`static String` | `INFO_STR`
`protected long` | `initializationMillis` The time at which this factory was initialized.
`static String` | `STDERR`
`static String` | `STDOUT`
`static String` | `TRACE_STR`
`static String` | `WARN_STR`

Constructor Summary
`LogFactoryImpl()`

Method Summary
`short` | `getDefaultLevel()` The default level for unconfigured log channels.
`String` | `getDiagnosticContext()` A string to prefix all log messages with.
`static short` | `getLevel(String str)` Returns a symbolic constant for the specified string level.
`static String` | `getLevelName(short level)` Returns a string representation of the specified log level constant.
`Log` | `getLog(String channel)` Return a log for the given channel name.
`PrintStream` | `getStream()` The stream to write to.
`protected LogFactoryImpl.LogImpl` | `newLogImpl()` Create a new log.
`void` | `setDefaultLevel(short level)` The default level for unconfigured log channels.
`void` | `setDefaultLevel(String level)` The string name of the default level for unconfigured log channels; used for automatic configuration.
`void` | `setDiagnosticContext(String val)` A string to prefix all log messages with.
`void` | `setFile(String file)` The stream to write to.
`void` | `setInto(Options opts)` Perform any generic configuration based on the data in `opts`.
`void` | `setStream(PrintStream stream)` The stream to write to.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TRACE_STR

    public static final String TRACE_STR

### INFO_STR

    public static final String INFO_STR

### WARN_STR

    public static final String WARN_STR

### ERROR_STR

    public static final String ERROR_STR

### FATAL_STR

    public static final String FATAL_STR

### STDOUT

    public static final String STDOUT

See Also:
  Constant Field Values

### STDERR

    public static final String STDERR

See Also:
  Constant Field Values

### initializationMillis

    protected final long initializationMillis

  The time at which this factory was initialized.

Constructor Detail

### LogFactoryImpl

    public LogFactoryImpl()

Method Detail

### getLog

    public Log getLog(String channel)

  Description copied from interface: `LogFactory`
  Return a log for the given channel name.

  Specified by:
    `getLog` in interface `LogFactory`

### newLogImpl

    protected LogFactoryImpl.LogImpl newLogImpl()

  Create a new log. The log will be cached.

### setDefaultLevel

    public void setDefaultLevel(String level)

  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

    public void setDiagnosticContext(String val)

  A string to prefix all log messages with. Set to `null` for no prefix.

### getDiagnosticContext

    public String getDiagnosticContext()

  A string to prefix all log messages with. Set to `null` for no prefix.

### setFile

    public void setFile(String file)

  The stream to write to. Recognized values are: `stdout` and `stderr`. Any other value will be considered a file name.

### getStream

    public PrintStream getStream()

  The stream to write to.

### setStream

    public void setStream(PrintStream stream)

  The stream to write to.

### getLevelName

    public static String getLevelName(short level)

  Returns a string representation of the specified log level constant.

### getLevel

    public static short getLevel(String str)

  Returns a symbolic constant for the specified string level.

### setInto

    public void setInto(Options opts)

  Description copied from interface: `GenericConfigurable`
  Perform any generic configuration based on the data in `opts`. This method should remove any values in `opts` that have been successfully processed; if any values remain in `opts` after this method is executed, an exception will be thrown identifying those key-value pairs as invalid.

  Specified by:
    `setInto` in interface `GenericConfigurable`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 Apache Software Foundation. All Rights Reserved.