Date: Fri, 29 Mar 2024 10:35:57 -0400 (EDT) Message-ID: <1039693259.163.1711722957121@lyrasis1-roc-mp1> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_162_1752989199.1711722957121" ------=_Part_162_1752989199.1711722957121 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The VIVO log file contains time-stamped statements intended to help you<= /p>
The log file is written to the logs
directory of your Tomca=
t application. It is usually called vivo.all.log
, but the name=
may vary, depending on how your VIVO was installed.
The log file can also be helpful during development and debugging. This = is particularly true if the developer takes advantage of the different logg= ing levels.
Here is an example of some code that writes to the log
private= static final Log log =3D LogFactory.getLog(WebappDaoSetup.class); ... log.info(elapsedSeconds + " seconds to set up models and DAO factories");= pre>
and here is the resulting line in the log:
2012-11= -15 12:20:37,406 INFO [<span class=3D"confluence-link">WebappDaoSetup= </span>] 3 seconds to set up models and DAO factories
The log holds the time that the statement was written, the severity leve=
l of the message,
the name of the Java class that wrote the statement, and the contents of t=
he statement itself.
Writing exceptions to the log can be tricky: check out this page on = ;Writing Exc= eptions to the Log
Each log message has an output level (sometimes known as a severity leve=
l).
The most common levels are DEBUG, INFO, WARN, ERROR.
Each level conveys a sense of how important the message is.
ERROR |
Serious errors which need to be addressed and= may result in unstable state. |
---|---|
WARN |
Runtime situations that are undesirable or un= expected, but not necessarily "wrong", especially if the system can compens= ate; "almost" errors. |
INFO |
Interesting runtime events; routine monitorin= g information. Commonly used to describe how the system starts up, or chang= es that are worth noting as the system runs. |
DEBUG |
Used by developers when debugging their code.= These messages will not appear in the log unless specifically enabled (see= below) |
The logging framework also supports the levels of FATAL
for=
very serious errors,
and TRACE
for verbose debugging messages, but these are much =
less commonly used.
The output levels for VIVO are determined by a file called
This file sets the general output level to INFO
, which mean=
s that messages at the INFO
level or higher will be written to=
the log. Messages at DEBUG
or lower will not be written to th=
e log.
The file also sets higher output levels for some classes that are otherw=
ise too chatty with their log messages. So for example, the Star=
tupStatus
class is assigned an output level of WARN
.&nb=
sp;This means that messages at the WARN
level or higher will b=
e written to the log, and messages at INFO
or lower will not.<=
/p>
Developers can make temporary changes to these settings by creating a fi=
le called [vitro-core]/webapp/config/debug.log4j.properties
When VIVO is rebuilt, the settings in this file will be used instead of = the settings in the default file. A developer will commonly change the= output level of the classes or packages he is currently working on, u= sing this file.
The debug settings file is ignored by Git. As a result it remains unique= to the individual developer, and can be changed without concern.
The debug settings file should not be present in a VIVO that is being bu= ilt for production use.
You can change the log levels for individual Java classes while VIVO is = running.
Direct your browser to [vivo]/admin/log4j.jsp
This page requires that you log in to VIVO as an =
administrator.
This page shows a list of all Java classes with active Logger components=
. Each class has a drop-down list that allows you to set the log output lev=
el for that class. Select the level(s) you want, and scroll to the bottom o=
f the page to click the button labeled Submit changes to logging leve=
ls
. The change is effective immediately.
This feature should be used with care. A log level of DEBUG
=
can significantly slow down some Java classes, and can result in very larg=
e amounts of output to the log of a busy system.
Note: The log4j.jsp
page shows only the classes with active Loggers. This means that you can't set use this page =
to set the output level of a class prior to the first time it is used. Java=
loads classes dynamically, and until the class is loaded, it does not have=
an active Logger.