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

Hi Members,

 

I wanted to check if we can update any config file so that the SAS Studio mid tier logs are rolled over based on the file size. The log grows at a tremendous pace and would like to ensure that we keep an eye on its size. It is present under

<sas config>/Lev1/Web/Logs/SASServer2*/SASStudioMidTier.log

 

Thanks in advance,

SK

1 ACCEPTED SOLUTION

Accepted Solutions
JuanS_OCS
Amethyst | Level 16

I believe there is no documentation about it in documentation.sas.com ( http://documentation.sas.com/?docsetId=logug&docsetTarget=p0vt6dps7nzkbgn0zntzi3qs3a0d.htm&docsetVer... ), however this system is based on a broadly commonly used Log4J and Apache.

 

https://wiki.apache.org/logging-log4j/Log4jXmlFormat

 

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
  <appender name="stdout" class="org.apache.log4j.ConsoleAppender"> 
    <layout class="org.apache.log4j.PatternLayout"> 
      <!-- Pattern to output the caller's file name and line number -->
      <param name="ConversionPattern" value="%5p [%t] (%F:%L) - %m%n"/> 
    </layout> 
  </appender> 
  <appender name="R" class="org.apache.log4j.RollingFileAppender"> 
    <param name="file" value="example.log"/>
    <param name="MaxFileSize" value="100KB"/>
    <!-- Keep one backup file -->
    <param name="MaxBackupIndex" value="1"/>
    <layout class="org.apache.log4j.PatternLayout"> 
      <param name="ConversionPattern" value="%p %t %c - %m%n"/> 
    </layout> 
  </appender> 
  <root> 
    <priority value ="debug" /> 
    <appender-ref ref="stdout" /> 
    <appender-ref ref="R" /> 
  </root>
</log4j:configuration>

 

 

View solution in original post

6 REPLIES 6
JuanS_OCS
Amethyst | Level 16

Hello @shirishkamath,

 

not the workspace server logs, but "sas/config/Lev1/Web/Common/LogConfig/SASStudio-log4j.xml"

 

You are looking for to un-comment the rolling appended functions

 

  <!-- A time/date based rolling appender
    <appender class="org.apache.log4j.DailyRollingFileAppender" name="SAS_FILE">
        <param name="datePattern" value="'.'yyyy-MM-dd"/>
        <param name="append" value="true"/>
        <param name="file" value="${config.lev.web.appserver.logs.dir}/SASStudioMidTier3.4.log"/>
        <layout class="com.sas.svcs.logging.CustomPatternLayout">
            <param name="ConversionPattern" value="%d [%t] %-5p [%u] %c - %m%n"/>
        </layout>
    </appender>
    -->

 

shirishkamath
Obsidian | Level 7
Thanks Juan. This helps. But can you also let me know what changes do I need to make in order to roll over the logs based on size? Looks like this piece will roll over the log based on time stamp?
JuanS_OCS
Amethyst | Level 16

I believe there is no documentation about it in documentation.sas.com ( http://documentation.sas.com/?docsetId=logug&docsetTarget=p0vt6dps7nzkbgn0zntzi3qs3a0d.htm&docsetVer... ), however this system is based on a broadly commonly used Log4J and Apache.

 

https://wiki.apache.org/logging-log4j/Log4jXmlFormat

 

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
  <appender name="stdout" class="org.apache.log4j.ConsoleAppender"> 
    <layout class="org.apache.log4j.PatternLayout"> 
      <!-- Pattern to output the caller's file name and line number -->
      <param name="ConversionPattern" value="%5p [%t] (%F:%L) - %m%n"/> 
    </layout> 
  </appender> 
  <appender name="R" class="org.apache.log4j.RollingFileAppender"> 
    <param name="file" value="example.log"/>
    <param name="MaxFileSize" value="100KB"/>
    <!-- Keep one backup file -->
    <param name="MaxBackupIndex" value="1"/>
    <layout class="org.apache.log4j.PatternLayout"> 
      <param name="ConversionPattern" value="%p %t %c - %m%n"/> 
    </layout> 
  </appender> 
  <root> 
    <priority value ="debug" /> 
    <appender-ref ref="stdout" /> 
    <appender-ref ref="R" /> 
  </root>
</log4j:configuration>

 

 

shirishkamath
Obsidian | Level 7
Awesome, thanks Juan 🙂 I really appreciate your help.
MariaD
Barite | Level 11

Hi @JuanS_OCS ,

 

On .../config/Lev1/Web/Common/LogConfig there is a config file for each components on my web server. There is any way to change make this change to all (general config file) or I need to change one by one?

 

Regards, 

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
  • 6 replies
  • 2245 views
  • 11 likes
  • 4 in conversation