veliovgroup/Meteor-logger-console

transported log always shows 'server', even if msg originates from client

edovino opened this issue · 3 comments

I guess that is to be expected (since the logging of the transported message does happen on the server), but can I configure the logging system so it shows the origin of the log event?

Hello @edovino ,

You're right, logging request is transferred from Client to Server.
I recommend to set caller side in data param:

log.info('message', {
  caller: (Meteor.isServer) ? 'Server' : 'Client'
}, 'userId');

Let me know if it is helpful.

yes - that will work perfectly! I'll make a wrapper to set 'data.caller' automatically, and use that in the format() function in the LoggerConsole adapter.
thx!

@edovino great, I'm glad it worked for you.

Please, support this project by: