Importing log messages from the CLI

The import command is used to import log messages from IIS log files and W3C Extended log files to an elmah.io log.

Usage

> elmahio import --help

Description:
  Import log messages to a specified log

Usage:
  elmahio import [options]

Options:
  --apiKey <apiKey> (REQUIRED)      An API key with permission to execute the command
  --logId <logId> (REQUIRED)        The ID of the log to import messages to
  --type <iis|w3c> (REQUIRED)       The type of log file to import. Use 'w3c' for W3C Extended Log File Format and
                                    'iis' for IIS Log File Format
  --filename <filename> (REQUIRED)  Defines the path and filename of the file to import from. Ex. " --filename
                                    C:\myDirectory\log.txt"
  --dateFrom <dateFrom>             Defines the Date from which the logs start. Ex. " --dateFrom 2023-03-06"
  --dateTo <dateTo>                 Defines the Date from which the logs end. Ex. " --dateTo 2023-03-13"
  -?, -h, --help                    Show help and usage information

Examples

IIS:

elmahio import --apiKey API_KEY --logId LOG_ID --type iis --filename u_inetsv1.log --dateFrom 2023-03-13T10:14 --dateTo 2023-03-13T10:16

w3c:

elmahio import --apiKey API_KEY --logId LOG_ID --type w3c --filename u_extend1.log --dateFrom 2023-03-13T10:14 --dateTo 2023-03-13T10:16


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