App42 Cloud API

Windows Phone Cloud SDK

Log

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.

In order to use the various functions available under a particular API, a developer will have to create an instance of ServiceAPI by passing the apiKey and the secretKey which has been received while creating an app.

	
ServiceAPI api = new ServiceAPI("<API_KEY>","<SECRET_KEY>");          

After initialization, developer needs to call the BuildXXXService method on ServiceAPI instance to get the instance of the particular API that you wish to build. For example, To build an instance of LogService, BuildLogService() method needs to be called.

	LogService logService = api.BuildLogService();

Once the API instance has been retrieved, You are ready to use the functions available for that particular API.

The Windows Phone API's work in an asynchronous mode that means the response will not be available immediately and all the API methods would not return any value and have return type as void. The response will be returned in callback methods which the caller will provide to the calling method.
As mentioned above that the response will be returned in callback methods, every API method is taking instance of App42Callback (as the last parameter) which will have the implementation of 2 methods: OnSuccess & OnException.(as shown below)

public class CallBack : App42Callback
{
public override void OnSuccess(Object obj)
{
Log log = (Log) obj;
//Do whatever you want with the user object
}
public override void OnException(App42Exception e)
{
//Do whatever you want with the exception
}
}

The callback methods will return the response in the form of Object which will have to be type cast to the object domain object (e.g. App42Response / Log in this case) The Domain object have the accessor / mutator to access the available properties for that object. You can get the response in the form of JSON as well. We have provided the JSON response with every function detail which can be retrieved by calling the ToString() on the returned object.

public override void OnSuccess(Object obj)
{
    Log log = (Log) obj; 
    String messageList =  logs.GetMessageList();  
    String jsonResponse = logs.ToString(); /* returns the response in JSON format. */ 
}
                            

The functions available under Logging API can throw some exceptions in abnormal conditions. Example of the same has been given below.

E.g. If App developer is requesting the logs for the module which is not in the database, the function will throw the App42Exception (as shown below) with message as "Not Found" and the appErrorCode as "2700" and the details as "Logs for the module '<module>' does not exist.".

		public override void OnException(App42Exception ex)
		{
			int appErrorCode = ex.GetAppErrorCode();
			int httpErrorCode = ex.GetHttpErrorCode();
			
			String jsonText = ex.GetMessage(); /* returns the Exception text in JSON format. (as shown below)*/	
		}
                            
	{
		"app42Fault": {
			"httpErrorCode": 404,
			"appErrorCode": 2700,
			"message": "Not Found",
			"details": "Logs for the module 'testmod' does not exist"
		}
	}							

Below are the HTTP Error Codes and their description, the function under the Logging API can throw.

/*
1400 - BAD REQUEST - The Request parameters are invalid
1401 - UNAUTHORIZED - Client is not authorized
1500 - INTERNAL SERVER ERROR - Internal Server Error. Please try again	
*/						

Below are the Application Error Codes and their description, the function under the Logging API can throw.

/*
2700 - NOT FOUND - Logs for the module '<module>' does not exist.
2701 - NOT FOUND - Logs for the type '<type>' does not exist.
2702 - Not Found - Logs betweem startDate '<startDate>' and endDate '<endDate>' does not exist.
2703 - NOT FOUND - Logs for the module '<module>' with text '<text>' does not exist.
2704 - NOT FOUND - The number of logs for the module '<module>' are less than the specified offset : <offset>.
2705 - NOT FOUND - The number of logs for the module '<module>' are less thanThe number of logs for the type '<type>' are less than the specified offset : <offset>.he specified offset : <offset>.
2706 - NOT FOUND - The number of logs betweem startDate '<startDate>' and endDate '<endDate>' are less than the specified offset : <offset>.
2707 - NOT FOUND - The number of logs for the module '<module>' with text '<text>' are less than the specified offset : <offset>.
*/			

Various functions available under Logging API has been explained below.

public void Info(String msg, String module, App42Callback requestCallback)

Logs the info message

Parameters:

msg - Message to be logged
module - Module name for which the message is getting logged
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing logged message

Response: Log Object

For more details click Exception
String msg = "Info logs";
String module =	"testmod";

logService.Info(msg ,module,requestCallback);   /* returns the Log object. */ 
OnSuccess(Object obj){
Log log  = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": {
                    "message": "Info logs",
                    "type": "INFO",
                    "logTime": "2012-05-09T12:38:17.437Z",
                    "module": "testmod"
                }
            }
        }
    }
}
public void Debug(String msg, String module, App42Callback requestCallback)

Logs the debug message

Parameters:

msg - Message to be logged
module - Module name for which the message is getting logged
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing logged message

Response: Log Object

For more details click Exception
String msg = "Debug logs";
String module =	"testmod";

logService.Debug(msg,module,requestCallback);   /* returns the Log object. */ 
OnSuccess(Object obj)
{
Log log  = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": {
                    "message": "Debug logs",
                    "type": "DEBUG",
                    "logTime": "2012-05-09T12:39:33.237Z",
                    "module": "testmod"
                }
            }
        }
    }
}
public void Error(String msg, String module, App42Callback requestCallback)

Logs the error message

Parameters:

msg - Message to be logged
module - Module name for which the message is getting logged.
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing logged message

Response: Log Object

For more details click Exception
String msg = "Error logs";
String module =	"testmod";	

logService.Error(message,module,requestCallback);   /* returns the Log object. */
OnSuccess(Object obj){
Log log  = (Log) obj; 
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": {
                    "message": "Error logs",
                    "type": "ERROR",
                    "logTime": "2012-05-09T12:45:47.435Z",
                    "module": "testmod"
                }
            }
        }
    }
}
public void Fatal(String msg, String module, App42Callback requestCallback)

Logs the fatal message

Parameters:

msg - Message to be logged
module - Module name for which the message is getting logged
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing logged message

Response: Log Object

For more details click Exception
String msg = "Fatal logs";
String module =	"testmod";	

logService.Fatal(message,module,requestCallback);   /* returns the Log object. */ 
OnSuccess(Object obj)
{
Log log  = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": {
                    "message": "Fatal logs",
                    "type": "FATAL",
                    "logTime": "2012-05-09T12:40:49.678Z",
                    "module": "testmod"
                }
            }
        }
    }
}
public void FetchLogsByModule(String moduleName, App42Callback requestCallback)

Fetch the log messages based on the Module

Parameters:

moduleName - Module name for which the messages has to be fetched
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing fetched messages

Response: Log Object

Exception:

This method throws following exception.
/* 
2700 - NOT FOUND - Logs for the module '<module>' does not exist.  
*/ 	        
For more details click Exception
String moduleName =	"testmod";
						
logService.FetchLogsByModule(moduleName,requestCallback);   /* returns the Log object. */ 
OnSuccess(Object obj){
Log log  = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": [
                    {
                        "message": "Info logs",
                        "logTime": "2012-05-09T12:37:57.000Z",
                        "module": "testmod",
                        "type": "INFO"
                    },
                    {
                        "message": "Info logs",
                        "logTime": "2012-05-09T12:38:17.000Z",
                        "module": "testmod",
                        "type": "INFO"
                    },
                    {
                        "message": "Debug logs",
                        "logTime": "2012-05-09T12:39:33.000Z",
                        "module": "testmod",
                        "type": "DEBUG"
                    },
                    {
                        "message": "Fatal logs",
                        "logTime": "2012-05-09T12:40:49.000Z",
                        "module": "testmod",
                        "type": "FATAL"
                    },
                    {
                        "message": "Error logs",
                        "logTime": "2012-05-09T12:45:47.000Z",
                        "module": "testmod",
                        "type": "ERROR"
                    }
                ]
            }
        }
    }
}
public void FetchLogsCountByModule(String moduleName, App42Callback requestCallback)

Fetch the count of log messages based on the Module

Parameters:

moduleName - Module name for which the count of messages has to be fetched
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

App42Response object containing count of fetched messages

Response: App42Response Object

Exception:

This method throws following exception.
/* 
2700 - NOT FOUND - Logs for the module '<module>' does not exist.  
*/ 		        
For more details click Exception
logService.FetchLogsCountByModule(moduleName,requestCallback);   /* returns the App42Response object. */ 
OnSuccess(Objcet obj)
{
Log log = (Log) obj;
App42Response response = (App42Response) email;
Boolean success = response.IsResponseSuccess();
int totalRecords = response.GetTotalRecords();
String jsonResponse = response.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "totalRecords": 3
        }
    }
}
public void FetchLogsByModule(String moduleName,int max, int offset, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing fetched messages

Response: Log Object

Exception:

This method throws following exception.
/* 
2700 - NOT FOUND - Logs for the module '<module>' does not exist. 
2704 - NOT FOUND - The number of logs for the module '<module>' are less than the specified offset : <offset>. 
*/ 	        
For more details click Exception
String moduleName = "testmod";
int max = 1;
int offset = 0;

logService.FetchLogsByModule(moduleName,max,offset,requestCallback);   /* returns the Log object. */ 
OnSuccess(Object obj){
Log log  = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": {
                    "message": "debug logs",
                    "logTime": "2012-06-02T14:08:26.000Z",
                    "module": "testmod",
                    "type": "DEBUG"
                }
            }
        }
    }
}
public void FetchLogsByModuleAndText(String moduleName, String text, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing fetched messages

Response: Log Object

Exception:

This method throws following exception.
/* 
2703 - NOT FOUND - Logs for the module '<module>' with text '<text>' does not exist.
*/ 		       
For more details click Exception
String moduleName = "testmod";
String text = "Info logs";	

logService.FetchLogsByModuleAndText(moduleName,text,requestCallback);   /* returns the Log object. */ 
OnSuccess(Object obj){
Log log  = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": [
                    {
                        "message": "Info logs",
                        "logTime": "2012-05-09T12:37:57.000Z",
                        "module": "testmod",
                        "type": "INFO"
                    },
                    {
                        "message": "Info logs",
                        "logTime": "2012-05-09T12:38:17.000Z",
                        "module": "testmod",
                        "type": "INFO"
                    }
                ]
            }
        }
    }
}
public void FetchLogsCountByModuleAndText(String moduleName, String text, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

App42Response object containing count of fetched messages

Response: App42Response Object

Exception:

This method throws following exception.
/* 
2703 - NOT FOUND - Logs for the module '<module>' with text '<text>' does not exist.
*/ 		       
For more details click Exception
String moduleName = "testmod";
String text = "debug logs";

logService.FetchLogsCountByModuleAndText(moduleName,text,requestCallback);   /* returns the App42Response object. */ 
OnSuccess(Objcet obj)
{
Log log = (Log) obj;
App42Response response = (App42Response) log;
Boolean success = response.IsResponseSuccess();
int totalRecords = response.GetTotalRecords();
String jsonResponse = response.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "totalRecords": 3
        }
    }
}
public void FetchLogsByModuleAndText(String moduleName, String text, int max, int offset, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing fetched messages

Response: Log Object

Exception:

This method throws following exception.
/* 
2707 - NOT FOUND - The number of logs for the module '<module>' with text '<text>' are less than the specified offset : <offset>.
*/ 		       
For more details click Exception
String moduleName = "testmod";
String text = "debug logs";
int max = 1;
int offset = 0;

logService.FetchLogsByModuleAndText(moduleName,text,max,offset,requestCallback);   /* returns the Log object. */ 
OnSuccess(Objcet obj){
Log log = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": {
                    "message": "debug logs",
                    "logTime": "2012-06-02T14:08:22.000Z",
                    "module": "testmod",
                    "type": "DEBUG"
                }
            }
        }
    }
}
public void FetchLogsByInfo(App42Callback requestCallback)

Fetch log messages based on Info Level.

Parameters:

requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing fetched info messages

Response: Log Object

Exception:

This method throws following exception.
/* 
2701 - NOT FOUND - Logs for the type '<type>' does not exist. 
*/ 		        
For more details click Exception
logService.FetchLogsByInfo(requestCallback);   /* returns the Log object. */ 
OnSuccess(Objcet obj)
{
Log log = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
} 
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": [
                    {
                        "message": "Info logs",
                        "logTime": "2012-05-09T12:37:57.000Z",
                        "module": "testmod",
                        "type": "INFO"
                    },
                    {
                        "message": "Info logs",
                        "logTime": "2012-05-09T12:38:17.000Z",
                        "module": "testmod",
                        "type": "INFO"
                    }
                ]
            }
        }
    }
}
public void FetchLogsCountByInfo(App42Callback requestCallback)

Fetch count of log messages based on Info Level

Parameters:

requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

App42Response object containing count of fetched info messages

Response: App42Response Object

Exception:

This method throws following exception.
/* 
2701 - NOT FOUND - Logs for the type '<type>' does not exist. 
*/ 		        
For more details click Exception
logService.FetchLogsCountByInfo(requestCallback);   /* returns the App42Response object. */ 
OnSuccess(Objcet obj)
{
Log log = (Log) obj;
App42Response response = (App42Response) log;
Boolean success = response.IsResponseSuccess();
int totalRecords = response.GetTotalRecords();
String jsonResponse = response.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "totalRecords": 3
        }
    }
}
public void FetchLogsByInfo(int max, int offset, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing fetched info messages

Response: Log Object

Exception:

This method throws following exception.
/* 
2705 - NOT FOUND - The number of logs for the module '<module>' are less thanThe number of logs for the type '<type>' are less than the specified offset : <offset>.he specified offset : <offset>.
*/ 		        
For more details click Exception
int max = 1;
int offset = 0;

logService.FetchLogsByInfo(max,offset,requestCallback);   /* returns the Log object. */ 
OnSuccess(Objcet obj)
{
Log log = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
} 
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": {
                    "message": "info logs",
                    "logTime": "2012-06-02T14:14:54.000Z",
                    "module": "testmod",
                    "type": "INFO"
                }
            }
        }
    }
}
public void FetchLogsByDebug(App42Callback requestCallback)

Fetch log messages based on Debug Level.

Parameters:

requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing fetched debug messages

Response: Log Object

Exception:

This method throws following exception.
/* 
2701 - NOT FOUND - Logs for the type '<type>' does not exist. 
*/ 		        
For more details click Exception
logService.FetchLogsByDebug(requestCallback);   /* returns the Log object. */ 
OnSuccess(Objcet obj)
{
Log log = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": {
                    "message": "Debug logs",
                    "logTime": "2012-05-09T12:39:33.000Z",
                    "module": "testmod",
                    "type": "DEBUG"
                }
            }
        }
    }
}
public void FetchLogsCountByDebug(App42Callback requestCallback)

Fetch count of log messages based on Debug Level

Parameters:

requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

App42Response object containing count of fetched debug messages

Response: App42Response Object

Exception:

This method throws following exception.
/* 
2701 - NOT FOUND - Logs for the type '<type>' does not exist. 
*/ 		       
For more details click Exception
logService.FetchLogsCountByDebug(requestCallback);   /* returns the App42Response object. */ 
OnSuccess(Objcet obj)
{
Log log = (Log) obj;
App42Response response = (App42Response) log;
Boolean success = response.IsResponseSuccess();
int totalRecords = response.GetTotalRecords();
String jsonResponse = response.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "totalRecords": 3
        }
    }
}
public void FetchLogsByDebug(int max, int offset, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing fetched debug messages

Response: Log Object

Exception:

This method throws following exception.
/* 
2705 - NOT FOUND - The number of logs for the module '<module>' are less thanThe number of logs for the type '<type>' are less than the specified offset : <offset>.he specified offset : <offset>.
*/ 		       
For more details click Exception
int max = 1;
int offset = 0;

logService.FetchLogsByDebug(max,offset,requestCallback);   /* returns the Log object. */ 
OnSuccess(Objcet obj)
{
Log log = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": {
                    "message": "debug logs",
                    "logTime": "2012-06-02T14:08:22.000Z",
                    "module": "testmod",
                    "type": "DEBUG"
                }
            }
        }
    }
}
public void FetchLogsByError(App42Callback requestCallback)

Fetch log messages based on Error Level.

Parameters:

requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing fetched error messages

Response: Log Object

Exception:

This method throws following exception.
/* 
2701 - NOT FOUND - Logs for the type '<type>' does not exist. 
*/ 		       
For more details click Exception
logService.FetchLogsByError(requestCallback);   /* returns the Log object. */ 
OnSuccess(Objcet obj){
Log log = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": {
                    "message": "Error logs",
                    "logTime": "2012-05-09T12:45:47.000Z",
                    "module": "testmod",
                    "type": "ERROR"
                }
            }
        }
    }
}
public void FetchLogsCountByError(App42Callback requestCallback)

Fetch count of log messages based on Error Level

Parameters:

requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

App42Response object containing count of fetched error messages

Response: App42Response Object

Exception:

This method throws following exception.
/* 
2701 - NOT FOUND - Logs for the type '<type>' does not exist. 
*/ 		       
For more details click Exception
logService.FetchLogsCountByError(requestCallback);   /* returns the App42Response object. */ 
OnSuccess(Objcet obj)
{
Log log = (Log) obj;
App42Response response = (App42Response) log;
Boolean success = response.IsResponseSuccess();
int totalRecords = response.GetTotalRecords();
String jsonResponse = response.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "totalRecords": 3
        }
    }
}
public void FetchLogsByError(int max, int offset, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing fetched error messages

Response: Log Object

Exception:

This method throws following exception.
/* 
2705 - NOT FOUND - The number of logs for the module '<module>' are less thanThe number of logs for the type '<type>' are less than the specified offset : <offset>.he specified offset : <offset>.
*/ 		       
For more details click Exception
int max = 1;
int offset = 0;

logService.FetchLogsByError(max,,offset,requestCallback);   /* returns the Log object. */ 
OnSuccess(Objcet obj){
Log log = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": {
                    "message": "error logs",
                    "logTime": "2012-06-02T14:17:14.000Z",
                    "module": "testmod",
                    "type": "ERROR"
                }
            }
        }
    }
}
public void FetchLogsByFatal(App42Callback requestCallback)

Fetch log messages based on Fatal Level.

Parameters:

requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing fetched Fatal messages

Response: Log Object

Exception:

This method throws following exception.
/* 
2701 - NOT FOUND - Logs for the type '<type>' does not exist. 
*/ 		       
For more details click Exception
logService.FetchLogsByFatal(requestCallback);   /* returns the Log object. */ 
OnSuccess(Objcet obj){
Log log = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": {
                    "message": "Fatal logs",
                    "logTime": "2012-05-09T12:40:49.000Z",
                    "module": "testmod",
                    "type": "FATAL"
                }
            }
        }
    }
}
public void FetchLogsCountByFatal( App42Callback requestCallback)

Fetch count of log messages based on Fatal Level

Parameters:

requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

App42Response object containing count of fetched fatal messages

Response: App42Response Object

Exception:

This method throws following exception.
/* 
2701 - NOT FOUND - Logs for the type '<type>' does not exist. 
*/ 		    
For more details click Exception
logService.FetchLogsCountByFatal(requestCallback);   /* returns the App42Response object. */ 
OnSuccess(Objcet obj)
{
Log log = (Log) obj;
App42Response response = (App42Response) log;
Boolean success = response.IsResponseSuccess();
int totalRecords = response.GetTotalRecords();
String jsonResponse = response.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "totalRecords": 3
        }
    }
}
						
public void FetchLogsByFatal(int max, int offset, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing fetched Fatal messages

Response: Log Object

Exception:

This method throws following exception.
/* 
2705 - NOT FOUND - The number of logs for the module '<module>' are less thanThe number of logs for the type '<type>' are less than the specified offset : <offset>.he specified offset : <offset>.
*/ 		   
For more details click Exception
int max = 1;
int offset = 0;

logService.FetchLogsByFatal(max,offset,requestCallback);   /* returns the Log object. */ 
OnSuccess(Objcet obj){
Log log = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
} 
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": {
                    "message": "fatal logs",
                    "logTime": "2012-06-02T14:18:00.000Z",
                    "module": "testmod",
                    "type": "FATAL"
                }
            }
        }
    }
}
public void FetchLogByDateRange(DateTime startDate, DateTime endDate, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing fetched messages

Response: Log Object

Exception:

This method throws following exception.
/* 
2702 - Not Found - Logs betweem startDate '<startDate>' and endDate '<endDate>' does not exist.	
*/ 		
For more details click Exception
DateTime startDate = DateTime.Today;
DateTime endDate = DateTime.Now;

logService.FetchLogsByDateRange(startDate, endDate,requestCallback);   /* returns the Log object. */ 
OnSuccess(Objcet obj){
Log log = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": [
                    {
                        "message": "Fatal logs",
                        "logTime": "2012-05-13T05:42:37.000Z",
                        "module": "testmod",
                        "type": "FATAL"
                    },
                    {
                        "message": "Hello",
                        "logTime": "2012-05-13T05:43:05.000Z",
                        "module": "Module",
                        "type": "DEBUG"
                    },
                    {
                        "message": "Hello",
                        "logTime": "2012-05-13T05:43:48.000Z",
                        "module": "Module",
                        "type": "DEBUG"
                    }
                ]
            }
        }
    }
}
public void FetchLogCountByDateRange(DateTime startDate, DateTime endDate, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

App42Response object containing count of fetched messages

Response: App42Response Object

Exception:

This method throws following exception.
/* 
2702 - Not Found - Logs betweem startDate '<startDate>' and endDate '<endDate>' does not exist.	
*/ 		   
For more details click Exception
DateTime startDate = DateTime.Today;
DateTime endDate = DateTime.Now;

logService.FetchLogsCountByDateRange(startDate,endDate,requestCallback);   /* returns the App42Response object. */ 
OnSuccess(Objcet obj)
{
Log log = (Log) obj;
App42Response response = (App42Response) log;
Boolean success = response.IsResponseSuccess();
int totalRecords = response.GetTotalRecords();
String jsonResponse = response.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "totalRecords": 90
        }
    }
}		
public void FetchLogByDateRange(DateTime startDate, DateTime endDate, int max, int offset, App42Callback requestCallback)

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
requestCallback - Callback instance that will have the implementation of OnSuccess & OnException of App42Callback.

Returns:

Log object containing fetched messages

Response: Log Object

Exception:

This method throws following exception.
/* 
2706 - NOT FOUND - The number of logs betweem startDate '<startDate>' and endDate '<endDate>' are less than the specified offset : <offset>.
*/ 	     
For more details click Exception
DateTime startTime = DateTime.Today;
DateTime endTime = DateTime.Now;
int max = 1;
int offset = 0;

logService.FetchLogsByDateRange(startTime,endTime,max,offset,requestCallback);   /* returns the Log object. */ 
OnSuccess(Objcet obj)
{
Log log = (Log) obj;
IList<Log.Message> messageList =  log.GetMessageList();  
for(int i = 0; i < messageList.Count; i++)
{
Console.WriteLine("msg is " + messageList[i].GetMessage());
Console.WriteLine("module is " + messageList[i].GetModule());
Console.WriteLine("type is " + messageList[i].GetType());
Console.WriteLine("logTime is " + messageList[i].GetLogTime());
} 
String jsonResponse = messageList.ToString(); /* returns the response in JSON format. (as shown below)*/
}
{
    "app42": {
        "response": {
            "success": true,
            "logs": {
                "log": {
                    "message": "info logs",
                    "logTime": "2012-06-05T10:59:27.000Z",
                    "module": "testmod",
                    "type": "INFO"
                }
            }
        }
    }
}