SAS 9 server log files contains lots of useful information to help you monitor, audit, and troubleshoot the usage of your SAS 9 platform deployments. However, sometimes the information you need might not be there by default. Thankfully the SAS 9 Logging Facility is flexible and allows a wide range of configuration customizations. Usually this is done by modifying the logconfig.xml file for the SAS server of interest, such as the SAS Metadata Server. This config file is normally only read when the SAS server restarts so you might not want to keep restarting a heavily used server to test out your logging config changes. This is where the SAS Management Console Server Manager plug-in shines. You can use it to connect to a SAS server, view all of the available loggers, change their logging levels, and have those changes take effect immediately without a server restart. If you find loggers and levels that give you the information you need, you can then update the config file and have the server restarted at a much more convenient time.
You can find the SAS documentation for this under Using SAS Management Console to Monitor SAS Servers. In this post I show how I use it to find interesting SAS metadata Server loggers.
If you launch SAS Management Console and navigate to the SAS Server Manager plug-in and then work your way down the server hierarchy from SASMeta to SASMeta – Logical Metadata Server to SASMeta – Metadata Server, you will find a Loggers tab. You will notice that it is initially greyed-out. To enable it, you right mouse click over SASMeta – Metadata Server and select the Connect action. You will be prompted for credentials and once you have authenticated, the Loggers tab will become available and be populated with a list of available loggers for that server.
I usually click on the Name column header to sort by logger name and then browse through the list to look for interesting looking loggers. If you see a potential candidate you can double click on it to open the loggers Properties dialog where you can change its logging level.
Many loggers are configured by default to log at the Info level (or they inherit an Info level from a parent logger). You can get them to show more information in the log file by turning up the level of logging to Debug or Trace. Be aware that this can produce a significantly large amount of logging, especially if you make the change for a high level logger that lower level loggers inherit from. I try to be picky, changing lower level loggers, assess the immediate impact on the log file and then, if they don’t give me what I want, turn them back down to what they were (often Inherited or Info). In the screenshot above you can see I have highlighted 3 loggers that I have set to Trace level. These are loggers that I find interesting in relation to auditing access control changes and I will follow up on those in the next blog post.
If you want to be able to identity which messages are emitted by which loggers then you can add the conversion character %c to the ConversionPattern setting in the SAS servers logconfig.xml file. That adds the logger name into the log record in the log file. For more info see Which logger did that SAS log message come from?
Any logging level changes you make to loggers using the SAS Management Console Server Manager plug-in are temporary. They will last until the next time the server is restarted, at which time it will pick up its defaults from the logconfig.xml file again. If you find loggers and logging levels that give you the information you need, and you want the changes to be permanent, then you can make them in the SAS server logconfig.xml and restart the server (or make them temporarily as above and wait for the next restart). There is also a method, using proc iomoperate, to tell the server to reload its logging config without a restart – see Dynamic Logging Reconfiguration in SAS® 9.3
I have mentioned the logconfig.xml file several times, but it may be different for you. The logging config file that will be used is actually specified in the logconfigloc option when the SAS server process is started. Whilst it is often logconfig.xml, the SAS configuration may be such that a different file such as logconfig.apm.xml or logconfig.trace.xml is used instead. Check your SAS 9 config files (sasv9*.cfg) to be sure you are editing the actual log config file in use!
I hope you found this post useful. Please post any comments about any SAS 9 loggers you have found interesting or useful in your work.
In the next blog post I will talk about the loggers highlighted in the image above that I find useful for security change auditing, especially when using the new Metacoda Plug-ins 6.2 Activity Reviewer.