Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

114
Visualizações
JavaScript console.error redirect to file in Daphne Django application

I am using systemd (on Debian) to launch a shell script (as me as a user):

startup.sh:

#/bin/bash
daphne -b '0.0.0.0' -p 8000 myProject.asgi:application 2> /tmp/log.out

In my Python (Django) application I need to output to stdout and have it show up on the screen (tty1), which is working fine. The problem is that the JavaScript console.error() messages are also showing up on the screen even though I am redirecting stderr when launching Daphne. Is there an easy way to have the JavaScript stderr also redirect to a file? (could be the same or a different file than /tmp/log.out)

My systemd service config is:

[Unit]
Description=Run my Django test server
DefaultDependencies=no
Requires=getty@tty1.service

[Service]
User=pi
Type=simple
WorkingDirectory=/opt/myModule
ExecStart=bash /opt/myModule/startup.sh
Restart=always
RestartSec=5
StandardOutput=tty
StandardError=journal
TTYPath=/dev/tty1
TTYVHangup=yes
TTYReset=yes

[Install]
WantedBy=basic.target
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The extra logging was coming from Daphne. I was able to redirect it to a log file by adding the --access-log flag:

daphne --access-log /tmp/daphne.log -b '0.0.0.0' -p 8000 myProject.asgi:application 2> /tmp/log.out

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda