builtins

log

Description

The `log` action allows for viewing and modifying the logging levels of various components within the CAS server. This is crucial for debugging and monitoring server activity. Different loggers can be targeted, and their verbosity can be adjusted from `OFF` to `ALL`. This action can affect the current session, all nodes, and even future sessions, which often requires administrator privileges.

proc cas; builtins.log / level="ALL" | "DEBUG" | "ERROR" | "FATAL" | "INFO" | "NULL" | "OFF" | "TRACE" | "WARN" logger="string" newSessions=TRUE | FALSE onMain=TRUE | FALSE; quit;
Settings
ParameterDescription
levelSpecifies the logging level to set. Levels range from `OFF` (no messages) to `ALL` (all messages), including `FATAL`, `ERROR`, `WARN`, `INFO`, `DEBUG`, and `TRACE`.
loggerSpecifies the name of the logger to modify (e.g., 'App', 'cas.config', 'cas.session').
newSessionsWhen set to TRUE, the logging change applies to all new sessions initiated on the server. This requires administrator privileges.
onMainWhen set to TRUE, the logging change is applied to the server controller. This requires administrator privileges.

Examples

This example sets the logging level for the 'App' logger to 'Trace' for the current session. This is useful for getting detailed diagnostic information for a specific application or process.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3BUILTINS.log logger="App" level="Trace";
4 
5RUN;
6 
7QUIT;
8 
Result :
The action returns a table that shows the loggers that were changed and their new logging levels. The results are printed to the SAS log. No CAS result table is returned to the client.

This example demonstrates how an administrator can change the logging level for the 'cas.config' logger to 'Debug' for all future sessions. This is a powerful tool for troubleshooting server-wide configuration issues. This requires administrator privileges.

SAS® / CAS Code Code awaiting community validation
Copied!
1 
2PROC CAS;
3BUILTINS.log logger="cas.config" level="Debug" newSessions=true;
4 
5RUN;
6 
7QUIT;
8 
Result :
A confirmation table is returned in the results, listing the logger, its new level, and the nodes it was applied to. The change will persist for any new CAS sessions created on the server.

FAQ

What is the purpose of the builtins.log action in SAS Viya?
What does the 'logger' parameter specify in the log action?
What are the possible values for the 'level' parameter?
How does the 'newSessions' parameter work?
What is the function of the 'onMain' parameter?