Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

115
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda