CORBA Interface IServerLog

Contains administrative methods that are used to control the collection of SAS logging events.

Definition

CORBA Module SASIOMCommon

IServerLog Description

The IServerLog interface contains administrative methods that are used to control the collection of SAS logging events. It provides functionality for filtering of the returned log entries based on message severity or for subsetting based on the Log4SAS hierarchy. It supports dynamic updating of the logging configuration.

CORBA Definitions
 method ClearIOMServerAppender  Removes any entries the IOMServerAppender may have already cached.
 method GetIOMServerAppenderView  Returns an IOMServerAppenderView interface.
 method GetStreamLogCfg  Returns current LogCfg contents.
 method SetStreamLogCfg  Sets new LogCfg configuration.


Java Classes
 IServerLogHelper  Used to manipulate the IServerLog type
 IServerLogHolder  Used to process the IServerLog type as an out parameter


Java Interfaces
 IServerLog  Contains administrative methods that are used to control the collection of SAS logging events.


Java Interface IServerLog

Contains administrative methods that are used to control the collection of SAS logging events.

Package com.sas.iom.SASIOMCommon

IServerLog Description
The IServerLog interface contains administrative methods that are used to control the collection of SAS logging events. It provides functionality for filtering of the returned log entries based on message severity or for subsetting based on the Log4SAS hierarchy. It supports dynamic updating of the logging configuration.

public interface IServerLog
extends org.omg.CORBA.Object

Method Summary

 void ClearIOMServerAppender ()

Removes any entries the IOMServerAppender may have already cached.

 IIOMServerAppenderView GetIOMServerAppenderView ( java.lang.String filter )
throws ( GenericError );

Returns an IOMServerAppenderView interface.

 octet[] GetStreamLogCfg ( )
throws ( GenericError );

Returns current LogCfg contents.

 void SetStreamLogCfg ( octet[] logCfg )
throws ( GenericError );

Sets new LogCfg configuration.


Java Class IServerLogHelper

public class IServerLogHelper

Description
Implementing class for methods (insert, extract, type, id, read, write, narrow) used to manipulate the IServerLog type.

java.lang.Object
  |
  +--com.sas.iom.SAS.IServerLogHelper

Java Class IServerLogHolder

public class IServerLogHolder

Description
Implementing class for methods (_read, _write, _type) used to process the IServerLog type as an out parameter.

java.lang.Object
  |
  +--com.sas.iom.SAS.IServerLogHolder


CORBA Method ClearIOMServerAppender

Removes any entries the IOMServerAppender may have already cached.

Description
The ClearIOMServerAppender method removes any entries the IOMServerAppender may have already cached. Entries are cached using two temporary host utility files. The first file is used for maintaining indexes into the second file which stores the log entries. Both files are uniquely named with a name prefix of "IOMServer" and a name postfix of "UTL". These files are truncated when the ClearIOMServerAppender is called.

Usage

Java Method ClearIOMServerAppender

void ClearIOMServerAppender ( )

Example


CORBA Method GetIOMServerAppenderView

Returns an IOMServerAppenderView interface.

Description
The GetIOMServerAppenderView method accepts an input string argument, the "filter", and returns an IOMServerAppenderView interface.

Usage

Java Method GetIOMServerAppenderView

public IIOMServerAppenderView GetIOMServerAppenderView (

    java.lang.String filter 
    )
    throws (
            GenericError
    );

Parameter Details

Parameter Direction Type Description
filter  in  java.lang.String  A set of name/value pairs, where the "name" portion cannot be localized, with support for the following filters:
name=[loggerName]
Specifies entries with given logger name. If not specified, all entries are available.
start=[startDateTime]
Starting date time of the entries that the caller is interested in. The date time format is ddmmmyyyy:hh:mm:ss.
end=[endDateTime]
Ending date time of the entries that the caller is interested in. If not set, this value defaults to the current date time. The date time format is ddmmmyyyy:hh:mm:ss.
level=[loggerLevel]
Entry level that the caller is interested in. If not specified, all levels are available. Available levels are TRACE, DEBUG, INFO, WARN, ERROR and FATAL.
threshold=[loggerLevel]
Minimum entry level that the caller is interested in. If not specified, all levels are available. The level= filter has precedence over the threshold filter.
columns=[column [,column]]
List of columns the IOMServerAppenderView ReadEntries method will return. The names of the columns cannot be localized. Columns are returned in the order specified. If not specified, the following columns are returned in this order: name, level, message, datetime. The current list of columns available are:
name     - Logger name.
level    - Logger event level.
message  - Rendered logger event message.
datetime - datetime of event.
 

Example


CORBA Method GetStreamLogCfg

Returns current LogCfg contents.

Description
The GetStreamLogCfg method returns a one dimensional array of octets containing the current LogCfg contents.

Usage

Java Method GetStreamLogCfg

octet[] GetStreamLogCfg (

    )
    throws (
            GenericError
    );

Parameter Details

Parameter Direction Type Description

Example


CORBA Method SetStreamLogCfg

Sets new LogCfg configuration.

Description
The SetStreamLogCfg method accepts a one dimensional array of octets containing the new LogCfg information. The array is passed into Log4SAS for it to reconfigure with. This stream does not persist. Therefore, when the server process exits, this configuration is lost.

Usage

Java Method SetStreamLogCfg

void SetStreamLogCfg (

    octet[] logCfg 
    )
    throws (
            GenericError
    );

Parameter Details

Parameter Direction Type Description
logCfg  in  octet[]  One dimensional array of octets containing the new LogCfg information.  

Example

This example demonstrates how to configure Log4SAS using IServerLog interface.

 1   import com.sas.iom.SASIOMCommon.IServerLog;
 2   import com.sas.iom.SASIOMCommon.IServerLogHelper;
 3   import com.sas.iom.SASIOMCommon.IIOMServerAppenderView;
 4   import com.sas.iom.SASIOMCommon.IIOMServerAppenderViewPackage.MapEOF;
 5
 6
 7    ...[code]...
 8
 9
10    // configure Log4SAS using IServerLog interface
11    IServerLog iServerLog = IServerLogHelper.narrow(obj);
12
13    // set hardcoded Log4SAS configuration into byte array.
14    StringBuffer cfg = new StringBuffer();
15    cfg.append("<?xml version=\"1.0\"?>");
16    cfg.append("<log4sas:configuration ");
17    cfg.append("xmlns:log4sas=\"http://www.sas.com/rnd/Log4SAS/\" ");
18    cfg.append("debug=\"true\">");
19    cfg.append("<appender name=\"IOMServer\" class=\"tk4aioms\">");
20    cfg.append("<param name=\"MaxEntries\" value=\"10000\"/>");
21    cfg.append("<layout>");
22    cfg.append("<param name=\"ConversionPattern\" ");
23    cfg.append("value=\"%d %-5p [%t] %c (%F:%L) - %m\"/>");
24    cfg.append("</layout></appender>");
25    cfg.append("<root><level value=\"trace\"/>");
26    cfg.append("<appender-ref ref=\"IOMServer\"/></root>");
27    cfg.append("</log4sas:configuration>");
28    String cfgStr = cfg.toString();
29    byte[] cfgb = cfgStr.getBytes();
30
31    try
32    {
33       iServerLog.SetStreamLogCfg(cfgb);
34    }
35    catch ( com.sas.iom.SASIOMDefs.GenericError gen )
36    {
37        // add code to handle exception
38    }