To import events, you
must first create an event importer service.
-
Select
ResourcesBrowsePlatforms, and then select the platform on which you want to
create the service.
-
On the detail page for
the selected platform, select
Tools MenuNew Platform Service.
-
On the
New
Service page, specify a name for the service and select
SAS
Event Importer in the
Service Type field.
Click
OK to define the service.
-
Select
ResourcesBrowseServices, and then select the SAS Event Importer service that
you just defined.
-
The detail page for
the service displays a message indicating that the service has not
been configured. Click the
Configuration Properties link.
-
On the
Configuration
Properties page, select the
importer.enable check
box to turn on event importing. Also select the
service.log_track.enable check
box to enable log tracking. Specify the log file that you want to
track in the
service.log_track.files field.
The file that you specify in this field is the log file that external
SAS applications or programs write to. Specify a single log file in
this field, and do not use wildcards in the filename. Click
OK to
save the configuration.
If you want a SAS program
to create an event, add the EVEVENT macro. This macro creates an event
in the proper format and stores it in a specified directory.
The format of an event
that can be imported is as follows:
dateTtimeoffset|msglevel|source|message
The date is
specified as yyyy-MM-dd.
The time is
specified as HH:mm:ss.
The msglevel must
be one of these values: ERROR, WARN, INFO, DEBUG.
Note: In order to use the EVEVENT
macro, you must access the code for the macro. Use %INCLUDE statements
to include the code for the %EVEVENT and %EVERRMSG macros in your
program. The source code for the macros is located in the /emi-framework/SASMacro
directory.
The syntax for the macro
is as follows:
%macro evevent(src=source_message_string,msglevel=message_level
,msgtext=message_string);
src=
specifies the originator
of the event. You can also use this parameter to specify the format
of the text in the msgtext= parameter. The value that you specify
for the format is specified by the parser. Use a colon (:) to separate
the originator and the format information.
msglevel=
specifies the level
of the event. Valid values are DEBUG
, INFO
, WARN
,
and ERROR
.
msgtext=
specifies the text
of the event message.