Version: v0.8.1 - Beta.  We welcome contributors & feedback.

Log.error

error($stringOrMap) -> self

Description

Appends an ERROR level message to data/logs/app.log as a line of JSON.

Log.error('Hello Log')

// {"date":"2024-09-18 00:14:37","level":"ERROR","url":"/your/page",message":"Hello Log"}}

You can also pass in a Map of data, which will be serialized and merged with the event data.

Log.error({ userId: 1234, event: 'loggedIn' })

// {"date":"2024-09-18 00:14:37","level":"ERROR","url":"/your/page","userId":1234,"event":"loggedIn"}}

See Also