Difference between revisions of "SUNScholar/Optimisations/Logs"

From Libopedia
Jump to navigation Jump to search
Line 27: Line 27:
 
  sudo -i
 
  sudo -i
  
mkdir /root/scripts
 
 
nano /root/scripts/fix-log-perms
 
Copy and paste the following.
 
<pre>
 
#!/bin/bash
 
 
chmod 0777 -R /home/dspace/log
 
</pre>
 
Make it executeable.
 
chmod 0755 /root/scripts/fix-log-perms
 
Add it to the root crontab
 
 
  crontab -e
 
  crontab -e
 
Add the following line.
 
Add the following line.
  @midnight   /root/scripts/fix-log-perms
+
  @midnight   chmod 0777 -R /home/dspace/log
 +
 
 
Save the crontab edit.
 
Save the crontab edit.
 
{{NANO}}
 
{{NANO}}
  
 
  '''[[SUNScholar/Optimisations|Back to Optimisations]]'''
 
  '''[[SUNScholar/Optimisations|Back to Optimisations]]'''

Revision as of 13:23, 17 March 2013

Tomcat Java web applications

Changed all instances of "INFO" to "ERROR" in the following config file to reduce disk I/O and CPU load.

nano /home/dspace/config/log4j.properties

Then copied the file to dspace-src config folder.

SOLR

Log level

Please note: The procedure below is not stable, so I installed PSI Probe using the Tomcat manager web interface and now I set the SOLR log level via the web gui after each re-build. See: https://code.google.com/p/psi-probe

See: http://lucidworks.lucidimagination.com/display/solr/Configuring+Logging and https://jira.duraspace.org/browse/DS-1460

Create the following file:

nano /home/dspace/dspace-1.8.2-src-release/dspace/modules/solr/src/main/webapp/WEB-INF/classes/logging.properties

Add the following to the file:

 org.apache.commons.digester.Digester.level = WARNING
 org.apache.solr.level = SEVERE

NANO Editor Help
CTL+O = Save the file and then press Enter
CTL+X = Exit "nano"
CTL+K = Delete line
CTL+U = Undelete line
CTL+W = Search for %%string%%
CTL+\ = Search for %%string%% and replace with $$string$$
CTL+C = Show line numbers

More info = http://en.wikipedia.org/wiki/Nano_(text_editor)


Save the file and rebuild.

Log file permissions

I setup a root cron crontab as follows.

sudo -i
crontab -e

Add the following line.

@midnight   chmod 0777 -R /home/dspace/log

Save the crontab edit.


NANO Editor Help
CTL+O = Save the file and then press Enter
CTL+X = Exit "nano"
CTL+K = Delete line
CTL+U = Undelete line
CTL+W = Search for %%string%%
CTL+\ = Search for %%string%% and replace with $$string$$
CTL+C = Show line numbers

More info = http://en.wikipedia.org/wiki/Nano_(text_editor)


Back to Optimisations