BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sathya66
Barite | Level 11

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

See https://documentation.sas.com/?docsetId=bisag&docsetTarget=p0atyzdgfzbsjfn1j4bbbt14ic7t.htm&docsetVe... 

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"

View solution in original post

10 REPLIES 10
Kurt_Bremser
Super User

See https://documentation.sas.com/?docsetId=bisag&docsetTarget=p0atyzdgfzbsjfn1j4bbbt14ic7t.htm&docsetVe... 

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"
sathya66
Barite | Level 11
Thanks,
Above config change is to trouble shoot the workspace server issues?
can we do this in logconfig.xml file? as we enabled the workspace logs in this logocfig.xml file.
sathya66
Barite | Level 11
don't have any issues with our workspace server but above link suggests don't amend logconfig_tarce.xml until sas requests so I am just thinking to amend it logconfig.xml
Kurt_Bremser
Super User

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"/> 
gwootton
SAS Super FREQ
By default the Workspace Server's logconfig.xml file does not create a log file, it only writes failures to the host system log (Events in Windows, syslog in Unix).

If you modified the default logconfig.xml to create a file it would only write those same things unless you added additional logger(s) to capture the other information you want.

I believe App.Program set to INFO would capture the submitted code and it's result, similar to what is seen in the Enterprise Guide log output.
--
Greg Wootton | Principal Systems Technical Support Engineer
Kurt_Bremser
Super User

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).

sathya66
Barite | Level 11

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.

Kurt_Bremser
Super User

@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.

AnandVyas
Ammonite | Level 13

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.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 10 replies
  • 2816 views
  • 5 likes
  • 4 in conversation