Skip to content
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

Can you provide a snippet of server implementation? #25

Open
rshailu opened this issue Oct 3, 2019 · 1 comment
Open

Can you provide a snippet of server implementation? #25

rshailu opened this issue Oct 3, 2019 · 1 comment

Comments

@rshailu
Copy link

rshailu commented Oct 3, 2019

I did something like this

app.post('/logger', (req, res) => {
  console.log(req.body);
   
});

I am not getting logs in backend.

@rshailu
Copy link
Author

rshailu commented Oct 4, 2019

Its working now, it seems format is very important. Needed to integrate loglevel with format
eg:

const customJSON = log => ({
 msg: log.message,
 level: log.level.label,
 stacktrace: log.stacktrace
});

remote.apply(log, { format: customJSON, url: '/logger' });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant