DATA Step, Macro, Functions and more

How to use log4sas mapped diagnostic context (MDC)

Reply
N/A
Posts: 1

How to use log4sas mapped diagnostic context (MDC)

As written in [1], there is support for MDC in SAS 9.2 with the implementation of log4sas.The Conversion pattern can look like:

%d %-5p [%t] %c (%F:%L) %X{myKey} --- %m

My questions:

How can I set a value for key myKey? Where is the map I need to access to set the value.

My intention is to set some parts of the log statement conditionally in my code, e.g. to identify a batch run, the batch run id should be contained.

But I don't want to set this id every time in my single log statements, just once (dynamically).

thx,

-martin

[¹] http://support.sas.com/documentation/cdl/en/logug/61514/PDF/default/logug.pdf

Ask a Question
Discussion stats
  • 0 replies
  • 133 views
  • 0 likes
  • 1 in conversation