Comments (9)
Version 0.12.0 is now published and should work with rocket as expected!
from flexi_logger.
Yes, exactly this is possible.
Example:
Logger::with_env_or_str("info, mymod1=debug, mymod2=error, mymod1::mysubmod = off")
will not log any messages from mymod1::mysubmod, although mymod1is set to "debug".
from flexi_logger.
nice, thanks for the clarification.
from flexi_logger.
so.. if I try using:
with_str("info, rocket=off")
I still see a bunch of output from rocket in the logfile:
INFO [rocket::rocket] 🔧 Configured for production.
INFO [rocket::rocket] address: ^[[1;49;39m0.0.0.0^[[0m
INFO [rocket::rocket] port: ^[[1;49;39m10000^[[0m
INFO [rocket::rocket] log: ^[[1;49;39moff^[[0m
INFO [rocket::rocket] workers: ^[[1;49;39m16^[[0m
INFO [rocket::rocket] secret key: ^[[1;49;39mprovided^[[0m
INFO [rocket::rocket] limits: ^[[1;49;39mforms = 32KiB^[[0m
INFO [rocket::rocket] keep-alive: ^[[1;49;39m5s^[[0m
INFO [rocket::rocket] tls: ^[[1;49;39mdisabled^[[0m
INFO [rocket::rocket] ^[[33m[extra]^[[0m template_dir: ^[[1;49;39m"templates"^[[0m
INFO [rocket::rocket] ^[[33m[extra]^[[0m databases: ^[[1;49;39m{ redis = { url = "redis://localhost" } }^[[0m
if I use:
with_str("mymodule")
I don't see any output from rocket and only output from mymodule
. Any ideas?
from flexi_logger.
from flexi_logger.
Fixed with 0.11.5 which is available now on crates.io
from flexi_logger.
I'm now on 0.11.5 and using with_env_or_str("info, rocket=off, serenity=off")
, but am still seeing the following in stdout:
ERROR [rocket::rocket] No matching routes for GET /index.php.
WARN [rocket::rocket] Responding with 404 Not Found catcher.
from flexi_logger.
Rocket uses the log crate in a pretty unusual way, by specifying the „target“ explicitly.
Unfortunately, the log crate is not very clear about the semantics of „target“.
The log macros fill it with the module path, and the log crate once recommended (iirc) and now states that most loggers use „target“ for filtering.
But log records also come with a „module path“, which contains by default the same info as „target“.
I have to experiment a bit. There are chances to make this cleaner, I think.
The log crate should define the semantics of target more precisely.
from flexi_logger.
I really think that rocket overstretches the possibilities of the log crate. I doesn't seem to be a good idea that libraries choose to log to different targets.
Nevertheless, there's a new flexi_logger version on master that should solve the issues with rocket for now. The fix has impact on the API for additional writers (which are addressed via the target info), so it is an alpha version of 0.12.
I will need to merge some other stuff in and polish before I can publish on crates.io.
from flexi_logger.
Related Issues (20)
- The program will panic when FileSpec.o_suffix is none.
- [Question] write to console first then log to file HOT 2
- v0.23.2 makes LoggerHandle no longer Clone HOT 1
- Make UTC offsets possible again
- SyslogWriter needs to append LF to buffer when try_tcp is used for connection
- Append & rotate on short running program... HOT 3
- use_utc() in v0.24.0 doesn't seem to work anymore HOT 3
- Writing to `std::fs::File` (or any type implementing `std::io::Write` trait) HOT 3
- RUSTSEC-2021-0139 - ansi_term
- logging to different log files HOT 2
- rotating log without `_rCURRENT` HOT 2
- flexi_logger::writers ignore log level HOT 2
- Allow different log levels for file and stderr logging HOT 1
- Consider removing feature flag from `DeferredNow::format_rfc3339`
- `DeferredNow::format_rfc3339` uses wrong timezone information
- FileLogWriter feature duplicate_to_stderr
- Keeping the logger handle alive HOT 1
- RUSTSEC-2021-0145 HOT 1
- Add support for capturing in tests HOT 1
- Get all log files include rolling
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 flexi_logger.