Class ErrorLog

java.lang.Object
com.portal.pcm.Log
com.portal.pcm.ErrorLog

public class ErrorLog extends Log
ErrorLog presents a Java interface for the PCM library error log.
  • Field Details

  • Constructor Details

    • ErrorLog

      public ErrorLog()
      Constructs an instance of ErrorLog. By default will log to the current directory using log named javapcm.log.
    • ErrorLog

      public ErrorLog(String path, String name, int flags)
      Constructs an instance of ErrorLog from a path, application name, and logging flags.
      Parameters:
      path - The path for the log file.
      name - The name of the application doing the logging.
      flags - Log control flags.
    • ErrorLog

      public ErrorLog(String path)
      Constructs an instance of ErrorLog from a path.
      Parameters:
      path - The path for the log file.
  • Method Details

    • setFlags

      public void setFlags(int flags)
      Sets the log flags.
      Parameters:
      flags - The new log flags.
    • setInMemoryFlag

      public void setInMemoryFlag(int value)
      Sets the inMemorylogflag.
      Parameters:
      value - - value
    • setInMemorySize

      public void setInMemorySize(long logsize)
      Sets the inMemorylogsize.
      Parameters:
      logsize - - log size
    • log

      public void log(String message) throws IOException
      Logs information to the log file.
      Parameters:
      message - the line to log.
      Throws:
      IOException
    • log

      public void log(Object src, String message) throws IOException
      Logs information to the log file.
      Parameters:
      src - If src is a string, it will be used to describe the source. otherwise the name of the object class will be used
      message - the line to log.
      Throws:
      IOException
    • getDefaultLog

      public static ErrorLog getDefaultLog()
      Returns the default error log object. This can be used to safely log errors. If used where there is no permission to create files, the log is generated in memory. The log may be read by thread in the current vm.

      The default log is controlled by the following properties set in the Infranet.properties file

      • log.file: name of the default log file; defaults to javapcm.log
      • log.level: valid values are
        • 0: no logging
        • 1: log errors only
        • 2: log errors and warnings
        • 3: log all messages (default)

      Returns:
      An ErrorLog object representing the default log ('javapcm.log')
    • openLog

      protected void openLog()
      Overrides:
      openLog in class Log