-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to generate or export the logs from the logger? #154
Comments
By default the logger outputs in the console (hit F12), filtering debug and info logs when the app is build for production. To add more outputs (for example to an online logger service), you just need to register a custom output function: // Logger output
function myCustomLoggerOutput(source: string, level: LogLevel, ...objects: any[]) {
// do something with the log, like pushing it to an online service
}
// Register new logger ouput
Logger.outputs.push(myCustomLoggerOutput); |
@sinedied I see, but when you generate this with a log.txt? I'm thinking to use this logger then create an interface where a user can extract the logs on their end based on a date to a .txt file. |
@sinedied my bad. I realized it is not possible to generate a log to a client-side js. I would need to send this to a server to write the logs. thank you. |
@sinedied quick question I'm trying to implement JSNLog by adding this as a new logger output. given to your example code, where do I place the code? |
You can place it along your app bootstrap code in a dedicated bootstrap service if you have one, otherwise you can simply put it in your root |
You've the logger in the app, how do you extract the information from it?
The text was updated successfully, but these errors were encountered: