com.heroku.api.request.log
Class Log.LogRequestBuilder

java.lang.Object
  extended by com.heroku.api.request.log.Log.LogRequestBuilder
Enclosing class:
Log

public static class Log.LogRequestBuilder
extends Object

Builder class for specifying log request parameters. Logs can be retrieved by specifying a process, the number of lines, etc... Once the params are specified, build the Log request with getRequest(). Use this builder to specify which params a Log should use. e.g.

new Log.LogRequestBuilder().app("myApp").ps("web.1").num(50).getRequest()


Constructor Summary
Log.LogRequestBuilder()
           
 
Method Summary
 Log.LogRequestBuilder app(String app)
          Name of the app to get logs for.
 Log getRequest()
          Finalize the params and get a Log request.
 Log.LogRequestBuilder num(int num)
          Number of log lines to retrieve.
 Log.LogRequestBuilder ps(String processName)
          Name of the process to get logs for.
 Log.LogRequestBuilder source(String source)
          The source of the logs.
 Log.LogRequestBuilder tail(boolean tail)
          Whether or not to tail the logs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log.LogRequestBuilder

public Log.LogRequestBuilder()
Method Detail

getRequest

public Log getRequest()
Finalize the params and get a Log request.

Returns:

app

public Log.LogRequestBuilder app(String app)
Name of the app to get logs for.

Parameters:
app - App name.
Returns:

num

public Log.LogRequestBuilder num(int num)
Number of log lines to retrieve.

Parameters:
num -
Returns:

ps

public Log.LogRequestBuilder ps(String processName)
Name of the process to get logs for. Process names can be seen by running HerokuAPI.listProcesses(java.lang.String), or by retrieving all logs and inspecting the value inside the brackets (e.g. web.1 from app[web.1]).

Parameters:
processName - Name of the process. e.g. "web.1"
Returns:

source

public Log.LogRequestBuilder source(String source)
The source of the logs. This can be found by reviewing the logs and looking at the value just after the timestamp. e.g. the source of 2012-03-23T18:46:01+00:00 heroku[router] is "heroku".

Parameters:
source -
Returns:

tail

public Log.LogRequestBuilder tail(boolean tail)
Whether or not to tail the logs. If true, a stream will be created that will remain open for an extended period of time.

Parameters:
tail -
Returns:


Copyright © 2012. All Rights Reserved.