- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 67
add logging overriding #36
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
base: main
Are you sure you want to change the base?
Conversation
9f35763    to
    457b390      
    Compare
  
    | +1 | 
    
      
        2 similar comments
      
    
  
    | +1 | 
| +1 | 
| +1 | 
457b390    to
    5ad2af6      
    Compare
  
    | @wchaws can you please add tag feature to fix failing test? thanks | 
| @07pepa I'm not the maintainer for this project. I just accidentally approved this PR. | 
| ok i thought you would have some extra rights if you could approve | 
…_existing_app ✨ Allow to use an existing app
5ad2af6    to
    fce4d85      
    Compare
  
    | +1 | 
fce4d85    to
    14cb9ad      
    Compare
  
    | +1 | 
| Hihi all, is anybody looking into fixing the labeler issue? Thanks | 
14cb9ad    to
    0961863      
    Compare
  
    | @mapapa i can't | 
| Can you please help this feature to go through @tiangolo? it's very annoying to see unnecessary access logs in production servers | 
| +1 I need ECS logging for fastapi run | 
26404c4    to
    c1974b1      
    Compare
  
    | Any updates here ? Could I take over if I need this functionality ? What is the problem with labels ? | 
| 
 this is problem with labes also  problem here #160 | 
| @darowny you can take over | 
| +1 i really need to change the uvicorn log level because some path like readiness and liveness in k8s are called every few seconds and the exception will "disappear" inside the logs after few minutes. | 
| +1 I also need this as the default logger doesn't have timestamps. When errors occur, it makes troubleshooting much more difficult. There are workarounds, but being able to specify a logging override would be the easiest method. | 
| I too would love to be able to override the logger - I'd like to be able to use the same formatter that's used for my application code. Especially the lack of timestamps for access logs is quite annoying. | 
| This pull request has a merge conflict that needs to be resolved. | 
c1974b1    to
    98095ce      
    Compare
  
    98095ce    to
    74093c6      
    Compare
  
    | +1, imo this is what stops this wrapper from being genuinely production-ready. | 
| Following up on my previous comment saying that after some studies I will suggest for production service to avoid  You can create the  import uvicorn
uvicorn.run(
    "app_folder.app_creator:app",
    host=<host>,  # example: "0.0.0.0"
    port=<port>,  # example: 8080
    workers=<workers>,  # example: 3
    reload=<reload>,  # false in production
    log_config=<logging_config dict> # Optional
)
 In  from fastapi import FastAPI
app = FastAPI(
    title="Your API",
    # all needed parameters and configurations
)
# Add routers, middleware, exception handlers, etc.
app.include_router(your_router) | 
sometimes its nice to have your custom logging in fastapi so i added passing it to uvicorn and fallbacking to uvicorn default one if nothing is passed in