kutuluk / loglevel-plugin-remote

A loglevel plugin for sending browser logs to a server
MIT License
102 stars 36 forks source link

Refreshing Token #12

Closed dustinjohnson13 closed 6 years ago

dustinjohnson13 commented 6 years ago

In its current implementation, there doesn't appear to be a way to provide a new token once the plugin has been configured. If the token is refreshed (e.g. timeout occurs and a new token is retrieved), how can we inject that token into the configuration? The only way I see to work around this issue is to completely reapply the plugin to the logger. Am I missing something in the configuration that addresses this?

kutuluk commented 6 years ago

Yes, now there is no other way to change the token. As well as there is no way to start sending messages only after receiving a token (the token is not always known at the time of the configuration of the logger). I'm aware of these problems and will close them in the next release.

kutuluk commented 6 years ago

@dustinjohnson13 @jonattfin

By the way, I have a few questions about how to use tokens. Let's talk about it?

dustinjohnson13 commented 6 years ago

I'm not all that knowledgable about JWT tokens, as I've never implemented them myself; I use them mainly at a superficial level (I'm a client of the API). That being said, I'm more than willing to answer if I do happen to know.

kutuluk commented 6 years ago

The user opens different pages of the site and the user can open several pages at the same time. In my opinion, to correctly log, it is necessary to provide the user with a unique token for each page he opens. Only then it will be clear what message from which page came.

Do you do this? Do you need any help from the logger, for example the URL field for each message? Or is the functionality provided enough?

dustinjohnson13 commented 6 years ago

We issue a new token for each page navigation and on each page reload (for right or wrong). So in our case we don't need a url field.

On Mon, Oct 16, 2017 at 2:20 AM kutuluk notifications@github.com wrote:

The user opens different pages of the site and the user can open several pages at the same time. In my opinion, to correctly log, it is necessary to provide the user with a unique token for each page he opens. Only then it will be clear what message from which page came.

Do you do this? Do you need any help from the logger, for example the URL field for each message? Or is the functionality provided enough?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kutuluk/loglevel-plugin-remote/issues/12#issuecomment-336801125, or mute the thread https://github.com/notifications/unsubscribe-auth/AE-BXSOWIYuDx_kM8xa8i4kcTXRzDtm6ks5sswPVgaJpZM4P4-Y0 .

kutuluk commented 6 years ago

I thought so, thank you.

kutuluk commented 6 years ago

A draft of the next release is ready. https://github.com/kutuluk/loglevel-plugin-remote/tree/next Does your problem solve the new implementation?

dustinjohnson13 commented 6 years ago

This looks great! We'd switched to minilog in the meantime, but now that this works so great, we've switched back. Any idea when this will be a fully-released version (for now I'm just pointing at the commit directly)?

kutuluk commented 6 years ago

Everything is ready, I was waiting for your comments only, to remake, if I missed something. Today I will release the next version.

dustinjohnson13 commented 6 years ago

Upgraded to 0.6.2, thanks for the good work!