com.atlassian.jira.util.log
Class JiraLogLocator

java.lang.Object
  extended by com.atlassian.jira.util.log.JiraLogLocator

public class JiraLogLocator
extends Object

Utility class to find the location of JIRA's log file. We try to locate the log file using:

  1. The file configured in the main appender. This is the best way and should work.
  2. The log file in the JIRA home directory (log/atlassian-jira.log).
  3. The atlassian-jira.log in the
It may be possible to have multiple JIRA log files sitting on the file system.

Since:
v4.1

Field Summary
static String AJL_FILE_NAME
          The name of the log file.
 
Constructor Summary
JiraLogLocator(JiraHome home)
           
 
Method Summary
 Collection<File> findAllJiraLogFiles()
          Return a collection of all JIRA log files.
 File findJiraLogFile()
          Return the main JIRA log file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AJL_FILE_NAME

public static final String AJL_FILE_NAME
The name of the log file.

See Also:
Constant Field Values
Constructor Detail

JiraLogLocator

public JiraLogLocator(JiraHome home)
Method Detail

findJiraLogFile

public File findJiraLogFile()
Return the main JIRA log file.

Returns:
the main JIRA log file. Can be null if it was not possible to find the log file.

findAllJiraLogFiles

@NotNull
public Collection<File> findAllJiraLogFiles()
Return a collection of all JIRA log files. JIRA may have multiple log files sitting around. All the returned files exist and can be read by JIRA.

Returns:
A collection of all JIRA log files. The returned collection is ordered such that the current log file comes first.


Copyright © 2002-2012 Atlassian. All Rights Reserved.