Comments (3)
Heya, can you tell what is log
in log.get_logger()
? It would be more beneficial if you can give some more code that preferably shows your logging config as well. I could not (maybe others could) make much from your MCVE.
from litestar.
This is expected behaviour and not an issue with Litestar.
I create loggers during the execution of API calls
You should not create a new logger for each API call. If you need a specific logger for these calls, you should create one logger for this which is then reused.
The threads being created is simply how the QueueListener
along with the QueueHandler
work.
You're likely not cleaning up the loggers properly (i.e. calling .stop()
, which stops the thread), causing them to go on indefinitely.
If you share an MCVE for this, we can maybe help you come up with a different solution for your logging needs.
from litestar.
This is expected behaviour and not an issue with Litestar.
Quite shocked about it.
I understand the necessity of offloading such operations to a separate thread, but it feels counterintuitive to me to spawn a new thread each time a new logger is created. I guess it is a necessary artifact of the huge logging framework python relies on.
No need for help then, I've refactored my code to just use 1 single global logger. Thanks!
from litestar.
Related Issues (20)
- Bug: LoggingMiddleware breaks static file serving
- Bug: Redirect is not allowed for a preflight request. HOT 2
- Bug: Enum OAS issues HOT 1
- Enhancement: email service provider integration HOT 3
- Enhancement: Context Managers as Dependencies HOT 1
- Enhancement: feat(monitoring): configurable path parameters cardinality
- Patching of click in rich-click via litestar cli breaks Typer cli apps HOT 5
- Bug: ASGI mounted at base root ("/") intercepts dynamic path params HOT 6
- Enhancement: add an option `logging_module` to `LoggingConfig` HOT 3
- Enhancement: Add class and funcion name to `ImproperlyConfiguredException`s HOT 4
- Docs: little typo in documentation HOT 1
- Bug: normal usage of route handler decorators causes deprecation warnings HOT 2
- Bug(SQLAlchemy Plugin): Generic responses are not getting serialized HOT 2
- Unexpected behavior from `module_to_os_path` HOT 4
- Exceptions not showing full traceback HOT 2
- Enhancement: Support configuring Pydantic's `.model_validate(..., strict=True`) HOT 2
- Bug: openapi spec. generation does not respect Response status_code HOT 2
- Bug: exception_handlers are not applied when debug flag is False HOT 2
- Docs: Mention the possibility to use UUIDv6 and UUIDv7 bases on db models
- Enhancement: ExternalDocumentation for ScalarRenderPlugin HOT 2
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 litestar.