all,
Enabled user workspace logs for the users but in the logs, it is not capturing the actual code when they run. It is capturing only when they connected/opened a session and if they have any ERRORs in their code/session.
How to capture all session logs along with user submitted code.
Thanks
Navigate to your WorkspaceServer path in the configuration.
Make a copy of the logconfig.trace.xml file (e.g. logconfig.xxx.xml).
In this file, modify this block:
<!-- IOM protocol message logger -->
<logger name="IOM" immutability="true">
<level value="Debug"/>
</logger>
from "Debug" to "Info". Additionally, change the FileNamePattern in line 10, if you want the log files in another location.
Save the file.
Then, add this line to your sasv9_usermods.cfg file:
-logconfigloc "/sasconf/Lev1/SASApp/WorkspaceServer/logconfig.xxx.xml"
Navigate to your WorkspaceServer path in the configuration.
Make a copy of the logconfig.trace.xml file (e.g. logconfig.xxx.xml).
In this file, modify this block:
<!-- IOM protocol message logger -->
<logger name="IOM" immutability="true">
<level value="Debug"/>
</logger>
from "Debug" to "Info". Additionally, change the FileNamePattern in line 10, if you want the log files in another location.
Save the file.
Then, add this line to your sasv9_usermods.cfg file:
-logconfigloc "/sasconf/Lev1/SASApp/WorkspaceServer/logconfig.xxx.xml"
Start with the logconfig.trace.xml. The change from "Debug" to "Info" prevents excessive logging.
With the standard logconfig.xml, you would have to implement a lot more changes, and end up with basically the same file.
Believe me, I have given you the EXACT layout of our logconfig file, which works very well in production.
This is the diff from trace to our file:
10c10
< <param name="FileNamePattern" value="/sas/conf/Lev1/SASApp/WorkspaceServer/Logs/SASApp_WorkspaceServer_%d_%S{hostname}_%S{pid}.log"/>
---
> <param name="FileNamePattern" value="$HOME/logs/SASApp_WorkspaceServer_%d_%S{hostname}_%S{pid}.log"/>
122c122
< <level value="Debug"/>
---
> <level value="Info"/>
while this is the diff from logconfig.xml to our file:
2c2
< <logging:configuration xmlns:logging="http://www.sas.com/xml/logging/1.0/">
---
> <logging:configuration xmlns:logging="http://www.sas.com/xml/logging/1.0/" debug="true">
3a4,17
> <!-- Rolling log file with default rollover of midnight -->
> <appender class="RollingFileAppender" name="TimeBasedRollingFile">
> <param name="Append" value="false"/>
> <param name="Unique" value="true"/>
> <param name="ImmediateFlush" value="true"/>
> <rollingPolicy class="TimeBasedRollingPolicy">
> <param name="FileNamePattern" value="$HOME/logs/SASApp_WorkspaceServer_%d_%S{hostname}_%S{pid}.log"/>
> </rollingPolicy>
> <layout>
> <param name="HeaderPattern" value="Host: '%S{hostname}', OS: '%S{os_family}', Release: '%S{os_release}', SAS Version: '%S{sup_ver_long2}', Command: '%S{startup_cmd}'"/>
> <param name="ConversionPattern" value="%d %-5p [%t] %X{Client.ID}:%u - %m"/>
> </layout>
> </appender>
>
10c24
< </filter>
---
> </filter>
69d82
<
82c95
< <level value="Error"/>
---
> <level value="error"/>
88d100
< <logger name="App" immutability="true"/>
90d101
< <logger name="IOM" immutability="true"/>
93c104
< <logger name="Admin.Operations" additivity="false">
---
> <logger name="Admin.Operations">
103a115,124
> <!-- Application message logger -->
> <logger name="App" immutability="true">
> <level value="Info"/>
> </logger>
>
> <!-- IOM protocol message logger -->
> <logger name="IOM" immutability="true">
> <level value="Info"/>
> </logger>
>
106a128
> <appender-ref ref="TimeBasedRollingFile"/>
Setting the logger to Info catches the log sent to the client into the log file, with the addition of tinestamps. I use these logs for documentation (e.g. possibld GDPR violations) and assistance (by displaying the N last lines of the file with tail I can watch "live" what people are doing, and do not have to rely on their descriptions).
Thanks,
I tested it and worked.
I will accept this as a solution and will close this ticket .
one last question.
what is the difference between
logconfig.xml vs logconfig.trace.xml (I know we use logconfig.trace.xml for tracing/debugging if we have any issues with workspace)
and
sasv9.cfg vs sasv9_usermods.cfg
or there is no difference.
@sathya66 wrote:
what is the difference between
logconfig.xml vs logconfig.trace.xml (I know we use logconfig.trace.xml for tracing/debugging if we have any issues with workspace)
See my other post to give you a picture.
and
sasv9.cfg vs sasv9_usermods.cfg
sasv9.cfg is the standard configuration file. Do not make any changes to it; updates to the SAS software will overwrite it. sasv9_usermods.cfg (as with any other _usermods files) is the place where you put your changes, as these files will not be overwritten by SAS updates.
Hi @sathya66
I would go with suggestion from @Kurt_Bremser . You can rename the logconfig.trace.xx.xml to logconfig.xml if you want. Make a backup of the original one.
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
Learn how to explore data assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.