Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Server

Notices

Reply
 
Thread Tools Search this Thread
Old 02-20-2025, 03:44 AM   #1
josemalop
Junior Member
josemalop began at the beginning.
 
josemalop's Avatar
 
Posts: 6
Karma: 10
Join Date: Feb 2025
Location: Almeria, Spain
Device: Kindle, Ipad
Log format of server-access-log.txt

Hello

I would like to set up a log parser (Awstats) for the calibre server, but the format in which the dates and times appear in the logs is not compatible with any of the supported formats.

Is there a way to change the output format of server-access-log.txt to suit Awstats (or any other log parser)?

Thanks in advance!

==================================

Buenos días

Me gustaría montar un analizador de logs (Awstats) del servidor de calibre, pero el formato en el que aparecen las fechas y las horas en el logs no es compatible con ninguno de los formatos admitidos.

¿Hay alguna forma de cambiar el formato de salida de server-access-log.txt para adecuarlo a Awstats (o cualquier otro analizador de logs)?

¡Gracias por adelantado!
josemalop is offline   Reply With Quote
Old 02-20-2025, 06:33 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,308
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Not without editing the source code, it isnt. Line 546 of http_response.py
kovidgoyal is online now   Reply With Quote
Advert
Old 02-20-2025, 06:45 AM   #3
josemalop
Junior Member
josemalop began at the beginning.
 
josemalop's Avatar
 
Posts: 6
Karma: 10
Join Date: Feb 2025
Location: Almeria, Spain
Device: Kindle, Ipad
Can you give me some indication so that the date format is one of these three (preferably the third one)?
  • [dd/mon/yyyy:hh:mm:ss +0000]
  • [dd/mon/yyyy:hh:mm:ss]
  • yyyy-mm-dd hh:mm:ss

Thanks in advance!
josemalop is offline   Reply With Quote
Old 02-20-2025, 08:04 AM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,410
Karma: 8012664
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
See https://docs.python.org/3/library/da...ptime-behavior for the format codes.
chaley is offline   Reply With Quote
Old 02-23-2025, 05:11 AM   #5
josemalop
Junior Member
josemalop began at the beginning.
 
josemalop's Avatar
 
Posts: 6
Karma: 10
Join Date: Feb 2025
Location: Almeria, Spain
Device: Kindle, Ipad
¡Muchas gracias por todo!

Al final he seguido las instrucciones de https://manual.calibre-ebook.com/develop.html para montar un entorno de desarrollo de calibre (intenté compilar todo pero me estaba dando más de un quebradero de cabeza) y he modificado la línea 546 del fichero http_response.py con el siguiente contenido:

Code:
ts = time.strftime('%d/%b/%Y:%H:%M:%S %z')
Después, en awstats, la directiva LogFormat quedaría tal que así:

Code:
LogFormat="%host %other %logname %time2 %methodurl %code %bytesd"
Y ahora funciona perfectamente, he montado awstats con el contenedor https://github.com/justb4/docker-awstats.

Un saludo, Josema
josemalop is offline   Reply With Quote
Advert
Old 02-26-2025, 06:53 AM   #6
josemalop
Junior Member
josemalop began at the beginning.
 
josemalop's Avatar
 
Posts: 6
Karma: 10
Join Date: Feb 2025
Location: Almeria, Spain
Device: Kindle, Ipad
To make future updates easier, would there be any possibility that the calibre-server log format setting could be changed from the calibre GUI?

===================================

De cara a facilitar las actualizaciones, ¿habría alguna posibilidad de que la configuración del formato del log de calibre-server se pudiera cambiar desde el GUI de calibre?
josemalop is offline   Reply With Quote
Old 02-26-2025, 07:15 AM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,308
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, not something I am interested in implementing, sorry.
kovidgoyal is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between log.debug, log.info, log.warn log.error lrpirlet Development 3 02-20-2021 03:43 AM
Access log not updated rbodewes Server 1 12-14-2019 12:24 PM
Access Log ZyloxDragon Server 3 10-10-2019 12:51 PM
Content Server -- access log info Ginnia Library Management 5 09-12-2017 06:07 AM
calibre-server access log? Geremia Calibre 5 06-29-2013 10:18 PM


All times are GMT -4. The time now is 03:04 AM.


MobileRead.com is a privately owned, operated and funded community.