Comments (9)
Would you like to send a Pull Request to address this issue? Remember to add unit tests.
from fastify-secure-session.
I'll try, but don't you think that it's not a good behavior to write library's internal logs using application's request.log method? Why don't use "debug" module which is kind of a standard approach for a library?
Anyway I'll come back soon when I'll get a chance to discover sources better.
from fastify-secure-session.
BTW, I didn't see these messages before, what was the reason of adding that?
from fastify-secure-session.
I'm sorry but I don't understand.. those are debug logs. Why is it a problem in including them here?
from fastify-secure-session.
Please take a look at PR, I`m not sure what kind of tests I can add there (btw logging is disabled at all in all existing tests).
Regarding why:
I'd like to keep my logs clean for obvious, I beleive, reasons: when something goes wrong you read the logs and the more usefull information there the better, and more usefull means less water. Settings/unsettings/removing/etc session usually not usefull, I'd like to log if session is set or isn't set by myself in cases when I need it and when I think it is important.
Now I have +1 line (in 99.99% of time it is just repeating line I mentioned in the first post) per each request.
So this PR aims to fix that.
If you need logs for your own debugging) why don't use own logging like https://github.com/visionmedia/debug ? I've been noticing it in many mature products and I use it in my projects - very easy to enable/disable with fine graining.
BTW, A lot of thanks for a perfect library!
from fastify-secure-session.
Why not just change your log level to something other than debug? They're written at the debug
level so that they're only present when you want the most verbose information. I think the default log level for fastify is info
, which would hide those logs.
from fastify-secure-session.
Why not just change your log level to something other than debug?
Then I'll lose request/response logs. It would be great if Fastify supported different logLevel for plugins, but, it seems, it's not going to be implemented soon (fastify/fastify#636).
from fastify-secure-session.
Do you mean request/response bodies? Because the incoming request / request completed logs are at the info level, so if you set the log level to info you'd still see them. Also, there's a PR linked there that would get you back debug logs if you want: fastify/fastify#639 , you'd have to set the level on each route you wanted them for which would be annoying but it's at least possible.
from fastify-secure-session.
ok, guys, nevermind, for a while, I just set log level to "info" when it was "trace". It seems it covers all business requirements.
Anyway (for the sake of justice), I believe, that plugins should not spoil request logs.
Also, one can disable Fasify logging and use hooks to log whatever he want (may be I'll use this approach later as it is more independent and flexible)
Cheers and close that.
from fastify-secure-session.
Related Issues (20)
- "k\" must be crypto_secretbox_KEYBYTES bytes long HOT 2
- `.bin` is not registered when using yarn HOT 6
- New cookie is made on every request, even if session is unchanged HOT 2
- Multiple cookies HOT 2
- v5.3.0 breaks with `Cannot read properties of undefined (reading 'sign')"` HOT 4
- Segmentation Fault when using alpine image HOT 7
- Enable multiple cookie sessions HOT 5
- Missing peer dependency on fastify HOT 8
- "No native build was found" HOT 3
- No native build was found - EsBuild AWS Lambda HOT 2
- Release new version to be type compatible with other `@fastify/cookie` modules HOT 1
- Update cookie expiration without updating data HOT 1
- i have been hack HOT 5
- Upgrade @fastify/cookie to 9.1.0 HOT 1
- Considering adding proprietary cookies good practices as Chrome make big changes on cookies in 2024 HOT 2
- typescript types don't work properly HOT 3
- changed value should be set to true when modifying objects within session HOT 1
- "reply.signCookie is not a function" when setting option signed: true HOT 2
- New "expiry" is not included in TypeScript definition HOT 2
- No way to update session expiration HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastify-secure-session.