ghiobi / tally-ticketsystem

Making Expensing Better Than Great Again
MIT License
1 stars 0 forks source link

Logger #192 #221

Closed miisaka closed 5 years ago

miisaka commented 5 years ago

story #192

Example sample log:

2019-04-13 00:34:58 INFO [server.js]: ========== Starting the application ==========
2019-04-13 00:34:59 INFO [server.js]: Registering routes...
2019-04-13 00:34:59 INFO [server.js]: Registering middlewares...
2019-04-13 00:35:01 ERROR [server.js]: Unable to send email to user [object Object] (email: user@tally.com. 
InvalidArgumentException: E_INVALID_PARAMETER: Make sure to define connection inside config/mail.js file
> More details: https://err.sh/adonisjs/errors/E_INVALID_PARAMETER)
Earthii commented 5 years ago

how come we didnt use Adonis's Logger ( i get that it uses WinstonJs underneath, but i meant why did we install it seperately, require it seperately ) https://adonisjs.com/docs/4.1/logger

miisaka commented 5 years ago

how come we didnt use Adonis's Logger ( i get that it uses WinstonJs underneath, but i meant why did we install it seperately, require it seperately ) https://adonisjs.com/docs/4.1/logger

Because AdonisJs' support for the file transport logging is mediocre with little documentation. Its just a wrapper on top of Winston but with a different config syntax that is barely documented. I spent a solid 2 hours trying to configure the built in one to behave the way I want it but to no success. Many other people seem to have the same complain as me so I decided to just use WinstonJs directly.

I am however using Adonis' built in console logger to log stuff to the console.