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

Add an optional identifier/prefix for debug logs emitted by an APNs client #30

Open
TysonAndre opened this issue Oct 13, 2020 · 1 comment

Comments

@TysonAndre
Copy link

Currently, node-apn emits debug logs such as apn Ping response after 11.645432 ms.

This is ambiguous if more than one provider/client instances are created, e.g. when pushing to more than one app, or if refreshing credentials and creating a new Provider (exceedingly unlikely).

It may be useful to have a prefix that could be added to the passed in options to disambiguate them to see when something went wrong in a given client, e.g. here, it could be inferred that first-app stopped responding to pings

apn first-app: Ping response after 11 ms
apn second-app: Ping response after 12 ms
apn second-app: Ping response after 12 ms
apn second-app: Ping response after 12 ms

Low priority because reliability will hopefully be improved in the next release

@TysonAndre TysonAndre changed the title Add an optional identifier/prefix for debug logs emitted by an APNs client Idea: Add an optional identifier/prefix for debug logs emitted by an APNs client? Oct 13, 2020
TysonAndre added a commit to TysonAndre/node-apn that referenced this issue Apr 6, 2021
For the sake of backwards compatibility, continue requiring DEBUG=apn to
log either of these.

For the sake of convenience, allow applications to manually override
these loggers on a per-Client instance basis.
A more fully-featured logger such as error/warn/info/debug might be
useful but overkill if the error conditions are rare in practice.

Related to parse-community#59
High volume uses of node-apn may benefit from logging errors but ignore
non-errors.

Related to parse-community#30
- setLogger can be used by applications to set their own prefix
TysonAndre added a commit to TysonAndre/node-apn that referenced this issue Apr 6, 2021
For the sake of backwards compatibility, continue requiring DEBUG=apn to
log either of these.

For the sake of convenience, allow applications to manually override
these loggers on a per-Client instance basis.
A more fully-featured logger such as error/warn/info/debug might be
useful but overkill if the error conditions are rare in practice.

Related to parse-community#59
High volume uses of node-apn may benefit from logging errors but ignore
non-errors.

Related to parse-community#30
- setLogger can be used by applications to set their own prefix
davimacedo pushed a commit that referenced this issue Apr 6, 2021
* Proposal: Add a configurable info/error logger

For the sake of backwards compatibility, continue requiring DEBUG=apn to
log either of these.

For the sake of convenience, allow applications to manually override
these loggers on a per-Client instance basis.
A more fully-featured logger such as error/warn/info/debug might be
useful but overkill if the error conditions are rare in practice.

Related to #59
High volume uses of node-apn may benefit from logging errors but ignore
non-errors.

Related to #30
- setLogger can be used by applications to set their own prefix

* Check if errorLogger is enabled
@mtrezza mtrezza changed the title Idea: Add an optional identifier/prefix for debug logs emitted by an APNs client? Add an optional identifier/prefix for debug logs emitted by an APNs client Mar 27, 2022
@parse-github-assistant
Copy link

Thanks for opening this issue!

  • ❌ Please edit your post and use the provided template when creating a new issue. This helps everyone to understand your post better and asks for essential information to quicker review the issue.

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

No branches or pull requests

2 participants