Use this method to send logs to a logging instance.
Service Limits
For more information about service limits on ingestion, such as body and message size, depth of nested fields, etc., refer to our documentation.
Post it
- Log into your LogDNA account and add
https://docs.logdna.com
to your whitelisted domains here. - Enter your LogDNA Ingestion Key in the
apikey
field. - Set a hostname:
docs-example
- Under BODY PARAMS, add a few lines to be sent to LogDNA
- Click the Try It! button.
If you sign in to the Mezmo log viewer, you'll now see the log line(s) you entered in the log viewer!
{
"lines": [
{
"timestamp": INSERT_UNIX_TIMESTAMP,
"line":"This is an awesome log statement",
"app":"myapp",
"level": "INFO",
"meta": {
"customfield": {
"nestedfield": "nestedvalue"
}
}
}
]
}
Curl it
If you like the good 'ol fashioned terminal, you can use the curl statement instead, but be sure to replace INSERT_INGESTION_KEY
with your LogDNA Ingestion Key and INSERT_UNIX_TIMESTAMP
with the timestamp of the log line, preferably in milliseconds.
Tweak it
In addition to basic auth, we also support an HTTP query string with the format, &apikey=your-ingestion-key
as well as a header token with the format apikey:your-ingestion-key
. While we appreciate thoroughness, please do not use more than one method of authentication per request! There is also a maximum payload size of 10 MB.
Metadata
Meta is a field reserved for custom information associated with a log line. To add metadata to an API call, specify the meta
field under the lines object. Metadata can be viewed inside that line's context.
WARNING: If inconsistent value types are used, that line's metadata, will not be parsed. For example, if a line is passed with a meta object, such as meta.myfield
of type String, any subsequent lines with meta.myfield
must have a String as the value type for meta.myfield
.