Comments (12)
@dstpierre If you don't have any questions I can start implementing it)
from core.
@dstpierre Sorry for misunderstanding.
And yes lumberjack has default value.
So we will use that)
from core.
Hey @dstpierre can you review my pr?
from core.
Some questions / thoughts to keep in mind:
- We need to stay backward compatible, so we'll need to have strong default when this get into production for version that will not change their config.
- I can see some devs wanting to have multi-output, we'll need a good way to configure this.
- What will be the strategy for replacing the current
fmt.Println
/log.Println
with the new logger, is this part of this change?
I like to hdea of using APP_ENV
with nice development defaults. I was looking at zerolog
which says their "pretty" output isn't optimal, so this should only be enabled for APP_ENV=dev
.
I'd like to discuss a bit regarding how one would configure this. As you explore which library you'd recommend, let us know what kind of options we have for non-console log (files, external services, etc).
Ideally I'd not want to add a hard dependency on a self-hosted log analysis. But we could certainly propose decent options.
from core.
What will be the strategy for replacing the current fmt.Println / log.Println with the new logger?
While watching the project I see that "fmt.Println / log.Println/ log.Fatal etc" doesn't happen very often.
So I guess that it won't be a problem to replace it manually.
Is this part of this change?
Yes sure.
I'd like to discuss a bit regarding how one would configure this. As you explore which library you'd recommend, let us know what kind of options we have for non-console log (files, external services, etc).
I don't know how to do this with "zerolog" because I have never worked with it.
But I know that "zap" logger has a built-in caller to write logs into the file and console at the same time.
Ex:
from core.
Multiple log output with zerolog.
So far I'd see the defaults behavior being:
APP_ENV=dev
-> Use a "pretty" log output for all levels (debug, info, etc)
LOG_CONSOLE_LEVEL
-> could be use to specify the minimum log level is wanted. For instance, LOG_CONSOLE_LEVEL=error
would not includes trace,debug,info and warning level: https://github.com/rs/zerolog#setting-global-log-level
LOG_FILENAME
-> if set, write logs to console and this file.
Now, should we think about monitoring size of this file? Who's responsible to clean this file?
How one ship this file to a 3rd party log analytics (self-hosted or paid).
Once we figure out the above, I think it'll be ready for implementation.
from core.
Now, should we think about monitoring size of this file? Who's responsible to clean this file?
It's not a problem we'll use "log rotation" with "lumberjack" + "zerolog".
How one ship this file to a 3rd party log analytics (self-hosted or paid).
Hmm. I don't expect to do this but probably in this part of the issue, it'll be manually working.
Maybe later we can do something better
from core.
"lumberjack" + "zerolog".
For example, it'll delete a log file after a certain period or when the file size equal to some value
from core.
Can you answer these questions?
- How many days do you want to keep old log files?
- How much max file size in MB do you want to see?
- How many backups of log files do you want to see?
from core.
How many days do you want to keep old log files?
I'd say a sane default would be 14 days to 30 days. Since the goal is most certainly to "ship" those log files somewhere else.
How much max file size in MB do you want to see?
I'd say 150-250 MB is probably an acceptable default. Rough questions I'd say, it's very situational.
How many backups of log files do you want to see?
Something like 3-7? I honestly don't know.
Does the library you're planning to use for log rotation suggests "fit-all" defaults?
from core.
Does the library you're planning to use for log rotation suggests "fit-all" defaults?
What do you mean while saying "fit-all defaults"?
If you talk about "defaults" from yesterday's message #44 (comment). The answer will be yes
from core.
@VladPetriv I'm just saying that I do not have hard specifics personally regarding log rotation, so if lumberjack has sane defaults, we should use that also by defaults.
from core.
Related Issues (20)
- Add ability to update and delete many entries by criteria HOT 8
- Support URL-like database DSN
- Problem when i try run docker build command HOT 2
- Create a dedicated accounts/users page in the web UI to view/manage users
- Fix TestHtmlToPDF occasional issue HOT 1
- Implement the in and !in query operators for PostgreSQL
- Local/dev Cache implementation missing pub/sub HOT 1
- Expose an HTTP client to the function runtime HOT 3
- Error when list/query for not created tables HOT 2
- The cache is returned instead of running postgres tests on CI
- Add the PublishDocument event trigger after the bulk update HOT 4
- Replace the PubSuber interface with the Volatilizer interface
- Expose the Volatilizer interface functions to the server-side runtime HOT 8
- Import a package from Go that embeds core's features without HTTP calls
- Add Count functions in database HOT 7
- [refactor]: Remove ShiftPath and replace with getURLPart HOT 3
- Implement a SQLite provider
- Implement a full-text search capability
- Embed UI templates via go:embed HOT 9
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 core.