Which logger did that SAS log message come from?

Occasionally you might want to generate a custom SAS log file, perhaps to be parsed and analysed to generate a custom report. You want to focus on a specific subset of messages and already know that you can modify the logging configuration file and attach the logger that generates the message to an appender to write the messages to your custom log file. The only thing you don’t know is which logger in particular is generating the messages you want to capture. You can see the messages you want already in the main log file but don’t know which logger is generating them. Is it App.Meta, Audit.Meta.Security, Audit.Authentication or something else? How do you find out which logger you need?

In situations like this I temporarily modify the logging configuration file (usually logconfig.xml) to add the conversion character %c to the ConversionPattern setting. This adds the logger name into the message. Restart the server in question and then look for the source of the interesting messages. Normally I only do this on a development server so I might leave the change in place so I can easily find the right logger next time.

Here’s an example of the ConversionPattern param in the SAS metadata server logging configuration file before the change:

<param name="ConversionPattern" value="%d %-5p [%t] %X{Client.ID}:%u - %m"/>

… and here’s the same param after adding in a “(%c)”:

<param name="ConversionPattern" value="%d %-5p [%t] (%c) %X{Client.ID}:%u - %m"/>

… and finally here’s a SAS metadata server log file fragment showing the result of the change:

2011-05-19T16:34:31,524 INFO  [00000004] (Admin.Operations) :sas - SAH011001I SAS (9.2) Metadata Server (8562), State, starting
2011-05-19T16:34:31,754 INFO  [00000008] (App.Meta) :sas - OMACONFIG option OMA.SASSEC_LOCAL_PW_SAVE found with value 1 and processed.
2011-05-19T16:34:31,755 INFO  [00000008] (App.Meta) :sas - Unable to load AES encryption algorithm. Using SASPROPRIETARY for password storage.
2011-05-19T16:34:31,755 INFO  [00000008] (App.Meta) :sas - Using SASPROPRIETARY for password fetch.
2011-05-19T16:34:31,760 INFO  [00000008] (Audit.Meta.Security) :sas - SAS Metadata Authorization Facility Initialization.
2011-05-19T16:34:31,761 INFO  [00000008] (Audit.Meta.Security) :sas - SAS is an adminUser.
2011-05-19T16:34:31,769 INFO  [00000008] (Audit.Meta.Security) :sas - SASTRUST@SASPW is a trustedUser.
2011-05-19T16:34:31,771 INFO  [00000008] (Audit.Meta.Security) :sas - SASADM@SASPW is an unrestricted adminUser.
...
2011-05-19T16:35:42,227 INFO  [00000164] (Audit.Authentication) :sasadm@saspw - New client connection (8) accepted from server port 8562 for user sasadm@saspw.  Encryption level is Credentials using encryption algorithm SASPROPRIETARY.  Peer IP address and port are [127.0.0.1]:52947.

Now I can see where the messages are coming from. Perhaps the Audit.Authentication message is the one I want.

You can find out more about conversion characters and configuring custom logging by reading the document SASĀ® 9.2 Logging Configuration and Programming Reference available from support.sas.com (PDF, HTML).

Update 20May2011: I forgot to mention that if you are generating a custom log file for the purposes of audit or performance logging, you might want to look first at the SAS 9.2 Enterprise Business Intelligence Audit and Performance Measurement instrumentation package. It might already provide what you need and if not then you might be able to make some small customisations rather than start from scratch.

Q&A Resources for SAS® Software

In addition to SAS Technical Support, there are a number of community support resources available for SAS users too. I have compiled a list below of the sites I know of that use a Q&A or discussion format where SAS users and platform administrators can post questions and review or provide answers.

  1. SAS Discussion Forums: provided by SAS Institute and hosting a number of different forums relating to specific aspects of SAS software. This is one of my favourites – it has a high degree of activity and relevance, lots of useful questions, and answers provided by both SAS users and employees alike.
  2. SAS Professionals Discussion Forums: provides a number of different discussion forums including a forum dedicated to Platform Administrators
  3. run;submit: a site dedicated to Q&A related to SAS software. It looks like a StackExchange site but, as far as I know, I don’t think it is affiliated with StackExchange (it’s not in the StackExchange sites list).
  4. Stack Overflow (SAS tag): a collaborative Q&A site from StackExchange dedicated to programmer’s questions. This is a link to the SAS tag that filters the questions to those about SAS software.
  5. SAS-L / comp.soft-sys.sas: SAS-L has been around for a long time and has a loyal following. Unfortunately it does also contain spam and inappropriate content too so beware.
  6. Super User (SAS tag): a collaborative Q&A site from StackExchange dedicated to computer enthusiast’s questions. This is a link to the SAS tag which includes some questions relating to SAS software (not as many as found on Stack Overflow) mixed in with questions about Serial Attached SCSI (SAS) disk drives and I/O controllers – seems like there is a tag name clash.

All of the Q&A sites above provide RSS feeds so you can monitor them from an RSS reader without having to keep visiting them individually.

LinkedIn members will also find many SAS software related groups with discussion boards. There are too many to list here individually, but if you are interested you will find some of them listed on my LinkedIn public profile. You can also find those groups and others by searching for LinkedIn groups using the SAS keyword.

If you are aware of any other Q&A sites for SAS users then please let me know by leaving a comment.