AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / server / Perguntas / 1168534
Accepted
Earthling
Earthling
Asked: 2024-12-05 13:07:13 +0800 CST2024-12-05 13:07:13 +0800 CST 2024-12-05 13:07:13 +0800 CST

Gunicorn error.log mostra um erro no log, mas o Gunicorn em si funciona

  • 772

Eu configurei o Nginx com gunciron e django. Tudo parece funcionar bem, pelo menos era o que eu acreditava. No entanto, quando eu verifico o diretório .gunicorn-logs conforme especificado para ser criado no docker e especifiquei o myscipt.sh abaixo, ele mostra 2 arquivos:

access.log com todo o acesso ao servidor gunciron e

error.log que deveria estar vazio mostra 1 kb de arquivo.

Upon inspection, I get this inside --->

Gunicorn error.log file --->
[2024-12-05 04:36:15 +0000] [85] [INFO] Starting gunicorn 23.0.0
[2024-12-05 04:36:15 +0000] [85] [INFO] Listening at: http://0.0.0.0:8585 (85)
[2024-12-05 04:36:15 +0000] [85] [INFO] Using worker: gthread
[2024-12-05 04:36:15 +0000] [88] [INFO] Booting worker with pid: 88
[2024-12-05 04:36:15 +0000] [89] [INFO] Booting worker with pid: 89
[2024-12-05 04:36:15 +0000] [90] [INFO] Booting worker with pid: 90
[2024-12-05 04:36:15 +0000] [91] [INFO] Booting worker with pid: 91

Gunciron access.log file --->
49.xxx.xxx.xx - - [05/Dec/2024:10:06:26 +0530] "GET /admin/login/?next=/admin/ HTTP/1.1" 200 4158 "-" "PostmanRuntime/7.43.0"
127.0.0.1 - - [05/Dec/2024:10:06:35 +0530] "GET /static/admin/ HTTP/1.1" 302 0 "-" "PostmanRuntime/7.43.0"
127.0.0.1 - - [05/Dec/2024:10:06:36 +0530] "GET /admin/login/?next=/static/admin/ HTTP/1.1" 200 4172 "http://34.xxx.xxx.xx:75/static/admin/" "PostmanRuntime/7.43.0"
127.0.0.1 - - [05/Dec/2024:10:06:42 +0530] "GET /static/admin/ HTTP/1.1" 302 0 "-" "PostmanRuntime/7.43.0"
127.0.0.1 - - [05/Dec/2024:10:06:42 +0530] "GET /admin/login/?next=/static/admin/ HTTP/1.1" 200 4172 "http://34.xxx.xxx.xx:75/static/admin/" "PostmanRuntime/7.43.0"

Os arquivos de log do nginx têm apenas o access.log preenchido e o error.log está vazio.

Nginx access.log file ---->
49.xxx.xxx.xx - - [05/Dec/2024:04:36:35 +0000] "GET /static/admin/ HTTP/1.1" 302 0 "-" "PostmanRuntime/7.43.0" "-"
49.xxx.xxx.xx - - [05/Dec/2024:04:36:36 +0000] "GET /admin/login/?next=/static/admin/ HTTP/1.1" 200 1522 "http://34.xxx.xxx.xx:75/static/admin/" "PostmanRuntime/7.43.0" "-"
49.xxx.xxx.xx - - [05/Dec/2024:04:36:42 +0000] "GET /static/admin/ HTTP/1.1" 302 0 "-" "PostmanRuntime/7.43.0" "-"
49.xxx.xxx.xx - - [05/Dec/2024:04:36:42 +0000] "GET /admin/login/?next=/static/admin/ HTTP/1.1" 200 1526 "http://34.xxx.xxx.xx:75/static/admin/" "PostmanRuntime/7.43.0" "-"

Veja como defini as linhas relacionadas ao servidor gunicorn dentro do dockerFile.

RUN mkdir -p .gunicorn-logs
RUN touch /opt/.gunicorn-logs/error.log
RUN touch /opt/.gunicorn-logs/access.log
RUN chmod +x /opt/.gunicorn-logs/
cmd myscipt.sh

O myscript.sh onde nginx e gunciron são invocados --->

#!/bin/sh
nginx -g 'daemon off;' & 
gunicorn mydjangoapi.wsgi:application --config=gunicorn_config_api-1.py

Finalmente, gunicorn_config_api-1.py parte da pasta raiz --->

bind = "0.0.0.0:8585"
loglevel = "INFO"
workers = "4"
threads="10"
reload = True

errorlog = "/opt/.gunicorn-logs/error.log"
accesslog = "/opt/.gunicorn-logs/access.log"
nginx
  • 1 1 respostas
  • 28 Views

1 respostas

  • Voted
  1. Best Answer
    anx
    2024-12-05T16:38:16+08:002024-12-05T16:38:16+08:00

    Quando você define, loglevel = "INFO"você está optando por [INFO]mensagens de -severity. É inteiramente esperado que você as veja, depois de tê-las solicitado especificamente.

    • 2

relate perguntas

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Você pode passar usuário/passar para autenticação básica HTTP em parâmetros de URL?

    • 5 respostas
  • Marko Smith

    Ping uma porta específica

    • 18 respostas
  • Marko Smith

    Verifique se a porta está aberta ou fechada em um servidor Linux?

    • 7 respostas
  • Marko Smith

    Como automatizar o login SSH com senha?

    • 10 respostas
  • Marko Smith

    Como posso dizer ao Git para Windows onde encontrar minha chave RSA privada?

    • 30 respostas
  • Marko Smith

    Qual é o nome de usuário/senha de superusuário padrão para postgres após uma nova instalação?

    • 5 respostas
  • Marko Smith

    Qual porta o SFTP usa?

    • 6 respostas
  • Marko Smith

    Linha de comando para listar usuários em um grupo do Windows Active Directory?

    • 9 respostas
  • Marko Smith

    O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL?

    • 3 respostas
  • Marko Smith

    Como determinar se uma variável bash está vazia?

    • 15 respostas
  • Martin Hope
    Davie Ping uma porta específica 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    kernel O scp pode copiar diretórios recursivamente? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh retorna "Proprietário incorreto ou permissões em ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil Como automatizar o login SSH com senha? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin Como lidar com um servidor comprometido? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner Como posso classificar a saída du -h por tamanho 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent Como determinar se uma variável bash está vazia? 2009-05-13 09:54:48 +0800 CST

Hot tag

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve