1.2.4 • Published 3 years ago

simple-papertrail-logger v1.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Why should you use this pakcage?

Becase Auth0 don't have a nice way of working with console output and logs, when using the new Actions. (or rules for that matter).

This package will make it easy for you to send logs to papertrail.

It defaults to failSilent, so your actions won't stop working just because the logging framework for some reason does not work.

See source code for properties and defaults. Happy coding 🍻

How to use

1) Add this package as a dependency, using the "Add Module" simple-papertrail-logger@latest. 2) Sign up for a papertrail account, and generate a log endpoint. This will give you a log token. 3) Save the log token to your secrects and call it LOG_KEY. 4) Use the logger in your code, like this:

const logger = new SimplePapertrailLogger({papertrailToken: context.secrets.LOG_KEY, logIdentifier: event.actor.hostname})
try {
    logger.addMessage('test this out');
} catch (err) {
    logger.addMessage('Some code failed');
} finally {
    logger.sendMessages()
    .then((result) => console.log(result)) // <== Make the result of the papertrail logs visible to Auth0 logs
}

If you need the unique id added to every log statement, you can simply acceess `logger.uniqueId` to get the 
1.2.4

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago