Exporting log messages from the CLI

The export command is used to export one or more log messages from a log to JSON.

Usage

> elmahio export --help

Description:
  Export log messages from a specified log

Usage:
  elmahio export [options]

Options:
  --apiKey <apiKey> (REQUIRED)      An API key with permission to execute the command
  --logId <logId> (REQUIRED)        The ID of the log to export messages from
  --dateFrom <dateFrom> (REQUIRED)  Defines the Date from which the logs start. Ex. " --dateFrom 2023-03-09"
  --dateTo <dateTo> (REQUIRED)      Defines the Date from which the logs end. Ex. " --dateTo 2023-03-16"
  --filename <filename>             Defines the path and filename of the file to export to. Ex. " --filename
                                    C:\myDirectory\myFile.json" [default:
                                    C:\Users\thoma\Export-638145521994987555.json]
  --query <query>                   Defines the query that is passed to the API [default: *]
  --includeHeaders                  Include headers, cookies, etc. in output (will take longer to export)
  -?, -h, --help                    Show help and usage information

Examples

Simple:

elmahio export --apiKey API_KEY --logId LOG_ID --dateFrom 2020-08-21 --dateTo 2020-08-28

Full:

elmahio export --apiKey API_KEY --logId LOG_ID --dateFrom 2020-08-21 --dateTo 2020-08-28 --filename c:\temp\elmahio.json --query "statusCode: 404" --includeHeaders


This article was brought to you by the elmah.io team. elmah.io is the best error management system for .NET web applications. We monitor your website, alert you when errors start happening, and help you fix errors fast.

See how we can help you monitor your website for crashes Monitor your website