duo-logger is a standalone NPM library developed for UserOfficeSoftware that provides simple and common interface for sending logs. Library is integrated with several applications and is configurable with variety of logging services. Comes with these out of the box implementations:
- Console Logger
- GrayLog
- Mute Logger
Use the package manager npm to install duo-logger.
npm install @user-office-software/duo-validation
Example for setting up console logger
import { ConsoleLogger, setLogger } from '@user-office-software/duo-logger';
// set ConsoleLogger as your logging service
setLogger(new ConsoleLogger());
Example for setting up Graylog logger
setLogger(
new GrayLogLogger(
'my-graylog-server.com',
12201,
{ environment: 'develop', service: 'my-service' },
[]
)
);
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.