Changing the Location of Retain Logs

  • 7019352
  • 29-Aug-2013
  • 30-Oct-2017

Environment


Retain 3.x
Windows
Linux

Situation


Customer wants to change the location of where the Retain log files are kept.

Resolution

Linux

To change the location of the log files, simply create a symbolic link (somewhat synonymous with Windows shortcuts).  Retain, by default, gives you the option during installation to store the logs at /var/log/retain-tomcat7 or at /opt/beginfinite/retain/tomcat7.  If stored at /var/log/retain-tomcat7, then Retain creates a symbolic link at /opt/beginfinite/retain/tomcat7 directory called 'logs" that points to the /var/... location.

1.  Create the directory in the location you wish to use.

2.  Stop tomcat.

3.  Move the current logs to the new location:  mv /var/log/retain-tomcat7/* /[path to new directory]

4.  Make tomcat the owner of the new directory path:  chown -R tomcat:tomcat /[path to new directory]

5.  Set the appropriate file *permissions for the tomcat user and group:  chmod -R 664 /[path to new directory]

If you are moving them to a separate volume, the file permissions must be 774.

6.  Create a symbolic link in the parent directory of the default logs directory and point it to the new location:

a.  Change to the /var/log directory.

b.  Remove the current log directory:  rm -r retain-tomcat7.

c.  Create a new symbolic link called retain-tomcat7 that points to your new log location:  ln -s [path to new directory] ./retain-tomcat7 (and press ENTER).

7.  Set the new Start tomcat.


Windows

1.  Ensure no archive jobs are running and stop Tomcat.

2.  Configure Tomcat's default log location.

a)  Click on Start.

b)  In the "Search programs and files" box, type: configure tomcat

c)  Click on Configure Tomcat

d)  Click on the Logging tab.

e)  Type in the new log path using the standard Windows path utilizing backslashes "\" (i.e., d:\retain\logs) or browse to it by clicking on the button with "..." on it.

f)  Click OK.

2.  Make a backup copy of the existing log4j.properties file.

3. Navigate to the following areas to change the log locations for Retain: 

        [drive]:\Program Files\Beginfinite\Retain\RetainServer\WEB-INF\classes

        [drive]:\Program Files\Beginfinite\Retain\RetainWorker\WEB-INF\classes

        [drive]:\Program Files\Beginfinite\Retain\RetainStatsServer\WEB-INF\classes

        [drive]:\Program Files\Beginfinite\Retain\RetainStubServer\WEB-INF\classes

        [drive]:\Program Files\Beginfinite\Retain\RetainWebUI\WEB-INF\classes

        [drive]:\Program Files\Beginfinite\Retain\RetainRouter\WEB-INF\classes

        [drive]:\Program Files\Beginfinite\Retain\ RetainServer\WEB-INF\ solrweb \WEB-INF\classes

           a) Edit the log4j.properties located at each of the locations above.

           b) Do a search on ${catalina.base}/logs/ and replace it with [desired path using forward slashes "/"]/logs/ (i.e., D:/retain/logs/). Be sure that the ${catalina.base} is removed and replaced with the new location.

                                An easy way to do this is to use the text editor's (i.e., Notepad") "Replace" function.

                               The line should look something like this after it is replaced: log4j.appender.R.File=D:/retain/logs

            4. Navigate to [drive]:\Program Files\Beginfinite\Retain\tomcat[8]\conf

          a) Edit the \logging.properties file.

            b) Do a search on ${catalina.base}/logs/ and replace it with [desired path using forward slashes "/"]/logs/ (i.e., D:/retain/logs/). Be sure that the ${catalina.base} is removed and replaced with the new location.

        An easy way to do this is to use the text editor's (i.e., Notepad") "Replace" function.

                                The line should look something like this after it is replaced: log4j.appender.R.File=D:/retain/logs

   5. Navigate to [drive]:\Program Files\Beginfinite\Retain\tomcat[8]\conf

          a)  Edit the server.xml file.

          b) Do a search for: localhost_access_log (Will be found near the bottom of the file). Just above the line is the line that reads: <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"

                      c) Change the 鈥渓ogs鈥 to the desired path using forward slashes ("/"). 

Additional Information

This article was originally published in the GWAVA knowledgebase as article ID 2199.