CodeMash Logs service logs all the requests and errors in your project. All the logs can be reached on the dashboard. In addition, you can create your custom logs from your own application.
To start using logs services and API methods you firstly need to enable logs service in your CodeMash dashboard.
Features included in logs service:
Logs - logs of various actions in your application.
Using SDK
If you decide to use one of our provided SDK, the following code shows how to initialize logs service.
var projectId =Guid.Parse("{YOUR_PROJECT_ID}");var apiKey ="{YOUR_SECRET_KEY}";var client =newCodeMashClient(apiKey, projectId);var logsService =newCodeMashLogsService(client);
The following are examples of logs SDK using different languages and frameworks.
usingSystem;usingCodeMash.Client;usingCodeMash.Membership.Services;usingIsidos.CodeMash.ServiceContracts;namespaceConsoleApplication{classProgram {staticvoidMain(string[] args) { // 1. Get your Project ID and Secret Keyvar projectId =Guid.Parse("{YOUR_PROJECT_ID}");var apiKey ="{YOUR_SECRET_KEY}"; // 2. Create a general client for API callsvar client =newCodeMashClient(apiKey, projectId); // 3. Create a service objectvar logsService =newCodeMashLogsService(client); // 4. Call an API methodlogsService.CreateLog(newCreateLogRequest { Message ="Custom log", Level ="Information" }); } }}