Administering SAS Web Applications |
Administering Logging Service Settings for Web Applications |
The SAS 9.2 Intelligence Platform uses a standard logging facility to perform logging for SAS servers. In SAS Management Console, the Logging Service Configuration dialog box enables you to accomplish several tasks for SAS Web applications:
Edit existing output types or create a new output type.
Save an output type with a new name.
Modify the layout pattern for the log message.
Specify log event output to Console, File, Socket, or ARM.
Define new outputs.
Track user logons. You can monitor usage patterns by logging activity for SAS Web application logons.
Change the logging levels.
For an overview and guidelines about logging, see "Administering Logging for SAS Servers" in the SAS Intelligence Platform: System Administration Guide.
The logging configuration for each application is controlled independently. For example, you can choose an application, such as SAS Web Report Studio or SAS Information Delivery Portal, and view or set logging levels for the application.
To see the logging configuration for a SAS application, follow these steps:
Log on to SAS Management Console.
On the Plug-ins tab, navigate to Environment Management Foundation Services Manager <Application> Core Logging Service.
Right-click Logging Service and select Properties. The Logging Service Properties dialog box appears.
Select the Service Configuration tab and then click Configuration. The Logging Service Configuration dialog box appears for the application.
The following display shows an example Logging Service Configuration dialog box.
Example Logging Service Configuration Dialog Box
For information about how to modify and customize the logging, see "Modifying Service Configurations" in the SAS Foundation Services: Administrator's Guide.
By default, the Logging Service Configuration dialog box in SAS Management Console contains two output types:
SAS_LS_CONSOLE
SAS_LS_FILE
One is a console output and the other is a file output.
Message logging is accomplished with a logging context. A logging context is usually the fully qualified class name of the class where the logging message originated. In the SAS Management Console, logging contexts are created or edited in the Logging Service Context window (accessed through the Logging Service Configuration dialog box).
The following logging contexts are common to all SAS applications:
com.sas
com.sas.services
com.sas.services.deployment
com.sas.services.discovery
com.sas.services.util
The five logging contexts are five packages that represent different locations in SAS software. These logging contexts should not be edited, but you can remove them or add additional logging contexts.
For detailed information about the logging facility, see SAS Logging: Configuration and Programming Reference.
By default, log files are stored in the SAS-configuration-directory\Lev\Web\Logs directory. Typically, you change the directory path for the location of the log files, if you have a clustered environment.
To modify the location of a log file, follow these steps:
Log on to SAS Management Console.
On the Plug-ins tab, navigate to Environment Management Foundation Services Manager <Application> Core Logging Service.
Right-click Logging Service and select Properties. The Logging Service Properties dialog box appears.
Select the Service Configuration tab and then click Configuration. The Logging Service Configuration dialog box appears for the application.
In the SAS Management Console, the Logging Service Configuration window enables you to configure the settings for logging. The log has five levels of detail: DEBUG, INFO, WARN, ERROR, and FATAL. Enabling a level also enables the less detailed levels above the selected level. By default, the level is set to WARN, which means that only WARN, ERROR, and FATAL messages are recorded. In large-scale deployments, the size of the log file can grow rapidly when INFO messages are enabled. However, you might want to enable the INFO messages during the development and testing phases.
If you need to debug a problem, it is recommended that you dynamically change the log output temporarily.
For an explanation of all warnings, see "Administering Logging for SAS Servers" in the SAS Intelligence Platform: System Administration Guide.
To change the types of messages that are stored in the log, choose the priority level for the appropriate logging context in the Logging Context dialog box. Here is a brief description of each type of logging:
DEBUG |
displays the informational events that are most useful for debugging an application. |
INFO |
displays informational messages that highlight the progress of the application. |
WARN |
displays potentially harmful situations. |
ERROR |
displays error events that might allow the application to continue to run. |
FATAL |
displays very severe error events that might cause the application to end abnormally. |
To enable a different level of log messages for an application, follow these steps:
Log on to SAS Management Console.
On the Plug-ins tab, navigate to Environment Management Foundation Services Manager <Application> Core Logging Service.
Right-click Logging Service and select Properties. The Logging Service Properties dialog box appears.
Select the Service Configuration tab and then click Configuration. The Logging Service Configuration dialog box appears for the application.
On the Contexts tab, select a context and click Edit. The Edit Logging Service Context dialog box appears.
Select the desired level of warning from the Priority drop-down list box.
Click OK to exit from each window.
To enforce the changes that you have made, restart the SAS Web application.
Understanding How the Web Applications Provide a Logging Context |
The SAS Web Infrastructure Platform has implemented a framework for providing separate logging contexts for the individual SAS Web applications. It is useful to understand how SAS implements individual logging contexts in case you need to modify any of the related configuration files. In addition, you might want to create a logging context for Web applications that are developed at your site.
The SAS Web applications implement this capability as follows:
The web.xml file for the Web application contains the following tag element:
<listener> <listener-class>com.sas.svcs.logging.LoggingContextListener </listener-class> </listener>
The listener element must directly follow the filter and filter-mapping elements and directly precede the servlet element. This listener is added as the first listener within the <web-app> element if there are multiple listeners.
The web.xml file also contains this tag:
<context-param> <param-name>log4j-config-name-prefix</param-name> <param-value>YourWebAppName</param-value> </context-param>
In the tag, YourWebAppName should be a name that contain no spaces or special characters (for example, SASWebReportStudio ). This name is prepended to -log4j.xml to form the filename of the application-specific log4j configuration file.
Web application servers have a property defined on their command line (com.sas.log.config.url) that points to the directory where the log4j config files are located. The framework within the SAS Web Infrastructure Platform uses this property to locate a particular Web applications's log4j configuration. The framework then loads the configuration into a private logging context for the Web application. Any loggers that the Web application obtains from a locally deployed Logging Service also shares this same private logging context. Check your Web application server start-up script or configuration file to determine the appropriate directory location.
Here is an example directory for a default deployment:
SAS-configuration-directory\Levn\Web\Common\LogConfig
The name of the log4j file has this form:
YourWebAppName-log4j.xml
where YourWebAppName is the string that was provided in the <context-param> element of the web.xml file.
A copy of the sas.svcs.commons.jar, which contains the com.sas.svcs.logging.LoggingContextListener class, must be in the Web application's CLASSPATH. This is accomplished by placing the JAR file within the WEB_INF/lib directory for the Web application.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.