When running Artifactory inside an existing servlet container, the container typically has its own log files.
These files normally contain additional information to that in
In Tomcat, these files are
The verbosity of any logger in your system can be configured by entering or modifying the
level value in the corresponding entry in the Logback configuration file
<logger name="org.apache.wicket"> <level value="error"/> </logger>
Artifactory loads any changes made to the Logback configuration file within several seconds without requiring a restart.
The Request and Access log files each display specific type of activity and as such have a consistent and specific file structure for maximum readability
A request log file record has the following structure:
Date and Time stamp | Request time | Request type | IP | User name | Request method | Requested resource path | Protocol version | Response code | Request Content-Length
Note: If not provided by the client, 'Request Content-Length' is initialised as "-1".
Here is a typical example:
Date and time stamp
|The date and time the request was completed and entered into the log file. Format is [YYYYMMDDHHMMSS]|
|The time in ms taken for the request to be processed|
DOWNLOAD for a download request
UPLOAD for an upload request
REQUEST for any other request
|The requesting user's IP address|
|The requesting user's user name or "non_authenticated_user" when accessed anonymously|
|The HTTP request method. e.g. GET, PUT etc.|
Requested resource path
|Relative path to the requested resource|
|The HTTP protocol version|
|The HTTP response code|
Size (bytes) of request or response
If request method is GET: Size of response
If request method is PUT or POST: Size of request
An access log file record has the following structure:
Date and Time stamp | Action response and type | Repository path (Optional) | Message (Optional) | User name | IP
Here is a typical example:
2014-05-08 15:52:27,456 [ACCEPTED DOWNLOAD] jcenter-cache:org/iostreams/iostreams/0.2/iostreams-0.2.jar for anonymous/86:12:14:192.
Date and Time stamp
|The date and time that the entry was logged. Format is [YYYY-MM-DD HH:MM:SS, milliseconds]|
[Action response and type]
|The response (ACCEPTED/DENIED) and the action type (e.g. DOWNLOAD, UPLOAD etc.)|
Repository path (Optional)
|The repository that was accessed|
|An optional system message|
|The accessing user's user name or "anonymous" when accessed anonymously|
|The accessing user's IP address|
You can view or download any of the Artifactory log files from the UI.
In the Admin module, under Advanced | System Logs, select the file you want to view from the drop-list. The log tail view is automatically refreshed every few seconds, however can be paused and resumed if you wish to browse the log.
To save system resources, do not leave the log view open in your browser unnecessarily.
Some sites want to consolidate logs into the syslog facility. Switching artifactory to use syslog in addition to, or instead of the standard log files takes a quick edit of a couple of files. Artifactory currently uses the logback library for logging, so that's what needs to be configured.
First edit the $ARTIFACTORY_HOME/etc/logback.xml file to send logs to the syslog facility. You need to add an appender to syslog:
<appender name="SYSLOG" class= "ch.qos.logback.classic.net.SyslogAppender">
<suffixPattern>[%thread] %logger %msg</suffixPattern>
then you need to add this appender to the output, in the section:
Save the file, you will not need to restart artifactory for this to take effect.
Since logback is using internet sockets, you have to make sure your syslog facility accepts them. Modern linux distributions are using the rsyslog daemon for syslogging. Ensure that the configuration for internet domain sockets is enabled, either by editing
/etc/rsyslog.conf and uncommenting:
# Provides UDP syslog reception
# Provides TCP syslog reception
or placing it in a file under
/etc/rsyslog.d ending in .conf
Rsyslog will need restarting with
service rsyslog restart for this to take effect.