com.shephertz.app42.paas.sdk.jme.log
Class LogService

java.lang.Object
  extended by com.shephertz.app42.paas.sdk.jme.log.LogService

public class LogService
extends java.lang.Object

Centralize logging for your App. This service allows different levels e.g. info, debug, fatal, error etc. to log a message and query the messages based on different parameters. You can fetch logs based on module, level, message, date range etc.

See Also:
Log

Constructor Summary
LogService(java.lang.String apiKey, java.lang.String secretKey, java.lang.String baseURL)
          this is a constructor that takes
 
Method Summary
 Log debug(java.lang.String msg, java.lang.String module)
          Logs the debug message
 Log error(java.lang.String msg, java.lang.String module)
          Logs the error message
 Log fatal(java.lang.String msg, java.lang.String module)
          Logs the fatal message
 Log fetchLogByDateRange(java.util.Date startDate, java.util.Date endDate)
          Fetch log messages based on Date range
 Log fetchLogByDateRange(java.util.Date startDate, java.util.Date endDate, java.lang.Integer max, java.lang.Integer offset)
          Fetch log messages based on Date range by paging.
 App42Response fetchLogCountByDateRange(java.util.Date startDate, java.util.Date endDate)
          Fetch count of log messages based on Date range
 Log fetchLogsByDebug()
          Fetch log messages based on Debug Level
 Log fetchLogsByDebug(java.lang.Integer max, java.lang.Integer offset)
          Fetch log messages based on Debug Level by paging.
 Log fetchLogsByError()
          Fetch log messages based on Error Level
 Log fetchLogsByError(java.lang.Integer max, java.lang.Integer offset)
          Fetch log messages based on Error Level by paging.
 Log fetchLogsByFatal()
          Fetch log messages based on Fatal Level
 Log fetchLogsByFatal(java.lang.Integer max, java.lang.Integer offset)
          Fetch log messages based on Fatal Level by paging.
 Log fetchLogsByInfo()
          Fetch log messages based on Info Level
 Log fetchLogsByInfo(java.lang.Integer max, java.lang.Integer offset)
          Fetch log messages based on Info Level by paging.
 Log fetchLogsByModule(java.lang.String moduleName)
          Fetch the log messages based on the Module
 Log fetchLogsByModule(java.lang.String moduleName, java.lang.Integer max, java.lang.Integer offset)
          Fetch the log messages based on the Module by paging.
 Log fetchLogsByModuleAndText(java.lang.String moduleName, java.lang.String text)
          Fetch log messages based on the Module and Message Text
 Log fetchLogsByModuleAndText(java.lang.String moduleName, java.lang.String text, java.lang.Integer max, java.lang.Integer offset)
          Fetch log messages based on the Module and Message Text by paging.
 App42Response fetchLogsCountByDebug()
          Fetch count of log messages based on Debug Level
 App42Response fetchLogsCountByError()
          Fetch count of log messages based on Error Level
 App42Response fetchLogsCountByFatal()
          Fetch count of log messages based on Fatal Level
 App42Response fetchLogsCountByInfo()
          Fetch count of log messages based on Info Level
 App42Response fetchLogsCountByModule(java.lang.String moduleName)
          Fetch the count of log messages based on the Module
 App42Response fetchLogsCountByModuleAndText(java.lang.String moduleName, java.lang.String text)
          Fetch count of log messages based on the Module and Message Text
 Log info(java.lang.String msg, java.lang.String module)
          Logs the info message
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogService

public LogService(java.lang.String apiKey,
                  java.lang.String secretKey,
                  java.lang.String baseURL)
this is a constructor that takes

Parameters:
apiKey -
secretKey -
baseURL -
Method Detail

debug

public Log debug(java.lang.String msg,
                 java.lang.String module)
          throws App42Exception
Logs the debug message

Parameters:
msg - - Message to be logged
module - - Module name for which the message is getting logged
Returns:
Log object containing logged message
Throws:
App42Exception

error

public Log error(java.lang.String msg,
                 java.lang.String module)
          throws App42Exception
Logs the error message

Parameters:
msg - - Message to be logged
module - - Module name for which the message is getting logged
Returns:
Log object containing logged message
Throws:
App42Exception

fatal

public Log fatal(java.lang.String msg,
                 java.lang.String module)
          throws App42Exception
Logs the fatal message

Parameters:
msg - - Message to be logged
module - - Module name for which the message is getting logged
Returns:
Log object containing logged message
Throws:
App42Exception

fetchLogByDateRange

public Log fetchLogByDateRange(java.util.Date startDate,
                               java.util.Date endDate)
                        throws App42Exception
Fetch log messages based on Date range

Parameters:
startDate - - Start date from which the log messages have to be fetched
endDate - - End date upto which the log messages have to be fetched
Returns:
Log object containing fetched messages
Throws:
App42Exception

fetchLogByDateRange

public Log fetchLogByDateRange(java.util.Date startDate,
                               java.util.Date endDate,
                               java.lang.Integer max,
                               java.lang.Integer offset)
                        throws App42Exception
Fetch log messages based on Date range by paging.

Parameters:
startDate - - Start date from which the log messages have to be fetched
endDate - - End date upto which the log messages have to be fetched
max - - Maximum number of records to be fetched
offset - - From where the records are to be fetched
Returns:
Log object containing fetched messages
Throws:
App42Exception

fetchLogCountByDateRange

public App42Response fetchLogCountByDateRange(java.util.Date startDate,
                                              java.util.Date endDate)
                                       throws App42Exception
Fetch count of log messages based on Date range

Parameters:
startDate - - Start date from which the count of log messages have to be fetched
endDate - - End date upto which the count of log messages have to be fetched
Returns:
App42Response object containing count of fetched messages
Throws:
App42Exception

fetchLogsByDebug

public Log fetchLogsByDebug()
                     throws App42Exception
Fetch log messages based on Debug Level

Returns:
Log object containing fetched debug messages
Throws:
App42Exception

fetchLogsByDebug

public Log fetchLogsByDebug(java.lang.Integer max,
                            java.lang.Integer offset)
                     throws App42Exception
Fetch log messages based on Debug Level by paging.

Parameters:
max - - Maximum number of records to be fetched
offset - - From where the records are to be fetched
Returns:
Log object containing fetched debug messages
Throws:
App42Exception

fetchLogsByError

public Log fetchLogsByError()
                     throws App42Exception
Fetch log messages based on Error Level

Returns:
Log object containing fetched error messages
Throws:
App42Exception

fetchLogsByError

public Log fetchLogsByError(java.lang.Integer max,
                            java.lang.Integer offset)
                     throws App42Exception
Fetch log messages based on Error Level by paging.

Parameters:
max - - Maximum number of records to be fetched
offset - - From where the records are to be fetched
Returns:
Log object containing fetched error messages
Throws:
App42Exception

fetchLogsByFatal

public Log fetchLogsByFatal()
                     throws App42Exception
Fetch log messages based on Fatal Level

Returns:
Log object containing fetched Fatal messages
Throws:
App42Exception

fetchLogsByFatal

public Log fetchLogsByFatal(java.lang.Integer max,
                            java.lang.Integer offset)
                     throws App42Exception
Fetch log messages based on Fatal Level by paging.

Parameters:
max - - Maximum number of records to be fetched
offset - - From where the records are to be fetched
Returns:
Log object containing fetched Fatal messages
Throws:
App42Exception

fetchLogsByInfo

public Log fetchLogsByInfo()
                    throws App42Exception
Fetch log messages based on Info Level

Returns:
Log object containing fetched info messages
Throws:
App42Exception

fetchLogsByInfo

public Log fetchLogsByInfo(java.lang.Integer max,
                           java.lang.Integer offset)
                    throws App42Exception
Fetch log messages based on Info Level by paging.

Parameters:
max - - Maximum number of records to be fetched
offset - - From where the records are to be fetched
Returns:
Log object containing fetched info messages
Throws:
App42Exception

fetchLogsByModule

public Log fetchLogsByModule(java.lang.String moduleName)
                      throws App42Exception
Fetch the log messages based on the Module

Parameters:
moduleName - - Module name for which the messages has to be fetched
Returns:
Log object containing fetched messages
Throws:
App42Exception

fetchLogsByModule

public Log fetchLogsByModule(java.lang.String moduleName,
                             java.lang.Integer max,
                             java.lang.Integer offset)
                      throws App42Exception
Fetch the log messages based on the Module by paging.

Parameters:
moduleName - - Module name for which the messages has to be fetched
max - - Maximum number of records to be fetched
offset - - From where the records are to be fetched
Returns:
Log object containing fetched messages
Throws:
App42Exception

fetchLogsByModuleAndText

public Log fetchLogsByModuleAndText(java.lang.String moduleName,
                                    java.lang.String text)
                             throws App42Exception
Fetch log messages based on the Module and Message Text

Parameters:
moduleName - - Module name for which the messages has to be fetched
text - - The log message on which logs have to be searched
Returns:
Log object containing fetched messages
Throws:
App42Exception

fetchLogsByModuleAndText

public Log fetchLogsByModuleAndText(java.lang.String moduleName,
                                    java.lang.String text,
                                    java.lang.Integer max,
                                    java.lang.Integer offset)
                             throws App42Exception
Fetch log messages based on the Module and Message Text by paging.

Parameters:
moduleName - - Module name for which the messages has to be fetched
text - - The log message on which logs have to be searched
max - - Maximum number of records to be fetched
offset - - From where the records are to be fetched
Returns:
Log object containing fetched messages
Throws:
App42Exception

fetchLogsCountByDebug

public App42Response fetchLogsCountByDebug()
                                    throws App42Exception
Fetch count of log messages based on Debug Level

Returns:
App42Response object containing count of fetched debug messages
Throws:
App42Exception

fetchLogsCountByError

public App42Response fetchLogsCountByError()
                                    throws App42Exception
Fetch count of log messages based on Error Level

Returns:
App42Response object containing count of fetched error messages
Throws:
App42Exception

fetchLogsCountByFatal

public App42Response fetchLogsCountByFatal()
                                    throws App42Exception
Fetch count of log messages based on Fatal Level

Returns:
App42Response object containing count of fetched Fatal messages
Throws:
App42Exception

fetchLogsCountByInfo

public App42Response fetchLogsCountByInfo()
                                   throws App42Exception
Fetch count of log messages based on Info Level

Returns:
App42Response object containing count of fetched info messages
Throws:
App42Exception

fetchLogsCountByModule

public App42Response fetchLogsCountByModule(java.lang.String moduleName)
                                     throws App42Exception
Fetch the count of log messages based on the Module

Parameters:
moduleName - - Module name for which the count of messages has to be fetched
Returns:
App42Response object containing count of fetched messages
Throws:
App42Exception

fetchLogsCountByModuleAndText

public App42Response fetchLogsCountByModuleAndText(java.lang.String moduleName,
                                                   java.lang.String text)
                                            throws App42Exception
Fetch count of log messages based on the Module and Message Text

Parameters:
moduleName - - Module name for which the count of messages has to be fetched
text - - The log message on which count of logs have to be searched
Returns:
App42Response object containing count of fetched messages
Throws:
App42Exception

info

public Log info(java.lang.String msg,
                java.lang.String module)
         throws App42Exception
Logs the info message

Parameters:
msg - - Message to be logged
module - - Module name for which the message is getting logged
Returns:
Log object containing logged message
Throws:
App42Exception