Class MSTRLog


  • public class MSTRLog
    extends java.lang.Object
    This is the logging infrastructure for the Java Web API. It can be used to turn on or off logging in the API by severity of message to be logged.
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean getDebugMonitorStatus()
      Returns true if logging to the platform-dependent debug monitor is active, false if it is not.
      static boolean getErrorLogStatus()
      Returns true if error logging is on, and false if it is not.
      static java.lang.String getLogFile()
      Returns the filename of the logfile that is currently set.
      static int getPerformanceLogStatus()
      Returns the current status of performance logging.
      static boolean getTraceLogStatus()
      Returns true if trace logging is on, and false if it is not.
      static boolean getWarningLogStatus()
      Returns true if warning logging is on, and false if it is not.
      static void logError​(java.lang.String componentInfo, java.lang.String errorMsg)
      Logs an error to the log file if logging is turned on for errors.
      static void logPerformance​(int _perfLogLevel, java.lang.String componentInfo, java.lang.String perfMsg)
      Logs a performance message to the logfile if performance logging is turned on.
      static void logTrace​(java.lang.String componentInfo, java.lang.String traceMsg)
      Logs a tracing message to the log file if tracing is turned on.
      static void logWarning​(java.lang.String componentInfo, java.lang.String warnMsg)
      Logs a warning message to the logfile if it is turned on.
      static void setAllLogging​(boolean isOn)
      Sets the logging for all events either on or off.
      static void setDebugMonitor​(boolean isOn)
      Enables logging to a "debug monitor".
      static void setErrorLog​(boolean isOn)
      Sets the logging setting for the logging of errors.
      static void setLogFile​(java.lang.String fileName)
      Sets the current log file to the filename specified and closes the previous logfile, if it was open.
      static void setPerformanceLog​(int perfLogLevel)
      Sets the logging setting for the logging of performance data.
      static void setTraceLog​(boolean isOn)
      Sets trace logging to either on or off.
      static void setWarningLog​(boolean isOn)
      Sets warning logging to either on or off.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getLogFile

        public static java.lang.String getLogFile()
        Returns the filename of the logfile that is currently set. Returns null if no filename is set.
        Returns:
        The filename currently set, or null if none is set.
      • getErrorLogStatus

        public static boolean getErrorLogStatus()
        Returns true if error logging is on, and false if it is not.
        Returns:
        The status of error logging.
      • getTraceLogStatus

        public static boolean getTraceLogStatus()
        Returns true if trace logging is on, and false if it is not.
        Returns:
        The status of trace logging.
      • getWarningLogStatus

        public static boolean getWarningLogStatus()
        Returns true if warning logging is on, and false if it is not.
        Returns:
        The status of warning logging.
      • getPerformanceLogStatus

        public static int getPerformanceLogStatus()
        Returns the current status of performance logging.
        Returns:
        The current performance logging level, from EnumPerformanceLogLevel.
      • getDebugMonitorStatus

        public static boolean getDebugMonitorStatus()
        Returns true if logging to the platform-dependent debug monitor is active, false if it is not.
        Returns:
        The status of debug monitor logging.
      • logError

        public static void logError​(java.lang.String componentInfo,
                                    java.lang.String errorMsg)
        Logs an error to the log file if logging is turned on for errors.
        Parameters:
        componentInfo - The name of the function/class that the error occurred in.
        errorMsg - The text of the error
      • logTrace

        public static void logTrace​(java.lang.String componentInfo,
                                    java.lang.String traceMsg)
        Logs a tracing message to the log file if tracing is turned on.
        Parameters:
        componentInfo - The name of the function/class that the trace occurred in.
        traceMsg - The text of the trace.
      • logWarning

        public static void logWarning​(java.lang.String componentInfo,
                                      java.lang.String warnMsg)
        Logs a warning message to the logfile if it is turned on.
        Parameters:
        componentInfo - The name of the function/class that the warning occurred in.
        warnMsg - The text of the warning
      • logPerformance

        public static void logPerformance​(int _perfLogLevel,
                                          java.lang.String componentInfo,
                                          java.lang.String perfMsg)
        Logs a performance message to the logfile if performance logging is turned on.
        Parameters:
        _perfLogLevel - The level of the message being logged, from EnumPerformanceLogLevel.
        componentInfo - The name of the function/class that the warning occurred in.
        perfMsg - The text of the performance message.
      • setAllLogging

        public static void setAllLogging​(boolean isOn)
        Sets the logging for all events either on or off.
        Parameters:
        isOn - true if logging for all events should be on, false if it should be off.
      • setPerformanceLog

        public static void setPerformanceLog​(int perfLogLevel)
        Sets the logging setting for the logging of performance data.
        Parameters:
        perfLogLevel - true if performance logging should be on, false if it should be turned off.
      • setErrorLog

        public static void setErrorLog​(boolean isOn)
        Sets the logging setting for the logging of errors.
        Parameters:
        isOn - true if error logging should be on, false if it should be turned off.
      • setLogFile

        public static void setLogFile​(java.lang.String fileName)
        Sets the current log file to the filename specified and closes the previous logfile, if it was open.
        Parameters:
        fileName - The fileName (with path if necessary) to use for logging.
      • setTraceLog

        public static void setTraceLog​(boolean isOn)
        Sets trace logging to either on or off.
        Parameters:
        isOn - true if trace logging should be turned on, false if it should be turned off.
      • setWarningLog

        public static void setWarningLog​(boolean isOn)
        Sets warning logging to either on or off.
        Parameters:
        isOn - true if warning logging should be turned on, false if it should be turned off.
      • setDebugMonitor

        public static void setDebugMonitor​(boolean isOn)
        Enables logging to a "debug monitor". This will vary from platform to platform, but for Windows NT this will be the Debug Monitor which traps calls to the Win32 API: OutputDebugString. Creation date: (9/20/00 4:00:05 PM)
        Parameters:
        isOn - if true, output for tracing, error, etc should be directed to a debug monitor.