hudson.logging
Class LogRecorder

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.logging.LogRecorder
All Implemented Interfaces:
ModelObject, Saveable, SearchableModelObject, SearchItem

public class LogRecorder
extends AbstractModelObject
implements Saveable

Records a selected set of logs so that the system administrator can diagnose a specific aspect of the system. TODO: still a work in progress.

Access Control

LogRecorder is only visible for administrators, and this access control happens at Jenkins.getLog(), the sole entry point for binding LogRecorder to URL.

Author:
Kohsuke Kawaguchi
See Also:
LogRecorderManager

Nested Class Summary
static class LogRecorder.Target
          Logger that this recorder monitors, and its log level.
 
Field Summary
static List<Level> LEVELS
          Log levels that can be configured for LogRecorder.Target.
 CopyOnWriteList<LogRecorder.Target> targets
           
static com.thoughtworks.xstream.XStream XSTREAM
          Thread-safe reusable XStream.
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
LogRecorder(String name)
           
 
Method Summary
 void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Accepts submission from the configuration page.
 void doDoDelete(org.kohsuke.stapler.StaplerResponse rsp)
          Deletes this recorder, then go back to the parent.
 void doRss(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          RSS feed for log entries.
 String getDisplayName()
           
 List<LogRecord> getLogRecords()
          Gets a view of the log records.
 String getName()
           
 LogRecorderManager getParent()
           
 String getSearchUrl()
          Returns the URL of this item relative to the parent SearchItem.
 void load()
          Loads the settings from a file.
 void save()
          Save the settings to a file.
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

targets

public final CopyOnWriteList<LogRecorder.Target> targets

XSTREAM

public static final com.thoughtworks.xstream.XStream XSTREAM
Thread-safe reusable XStream.


LEVELS

public static List<Level> LEVELS
Log levels that can be configured for LogRecorder.Target.

Constructor Detail

LogRecorder

public LogRecorder(String name)
Method Detail

getDisplayName

public String getDisplayName()
Specified by:
getDisplayName in interface ModelObject

getSearchUrl

public String getSearchUrl()
Description copied from interface: SearchItem
Returns the URL of this item relative to the parent SearchItem.

Specified by:
getSearchUrl in interface SearchItem
Returns:
URL like "foo" or "foo/bar". The path can end with '/'. The path that starts with '/' will be interpreted as the absolute path (within the context path of Hudson.)

getName

public String getName()

getParent

public LogRecorderManager getParent()

doConfigSubmit

public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req,
                           org.kohsuke.stapler.StaplerResponse rsp)
                    throws IOException,
                           javax.servlet.ServletException
Accepts submission from the configuration page.

Throws:
IOException
javax.servlet.ServletException

load

public void load()
          throws IOException
Loads the settings from a file.

Throws:
IOException

save

public void save()
          throws IOException
Save the settings to a file.

Specified by:
save in interface Saveable
Throws:
IOException - if the persistence failed.

doDoDelete

public void doDoDelete(org.kohsuke.stapler.StaplerResponse rsp)
                throws IOException,
                       javax.servlet.ServletException
Deletes this recorder, then go back to the parent.

Throws:
IOException
javax.servlet.ServletException

doRss

public void doRss(org.kohsuke.stapler.StaplerRequest req,
                  org.kohsuke.stapler.StaplerResponse rsp)
           throws IOException,
                  javax.servlet.ServletException
RSS feed for log entries.

Throws:
IOException
javax.servlet.ServletException

getLogRecords

public List<LogRecord> getLogRecords()
Gets a view of the log records.



Copyright © 2004-2013. All Rights Reserved.