Giter Site home page Giter Site logo

Comments (5)

the01 avatar the01 commented on July 23, 2024

I have some limited experience with logging, so here is how I see it:

  • simply use logging.debug(), logging.error(), logging.warning() etc. (or rather loggers)
  • The easiest way would be to setup logging to a file
  • The logging module has the concept of handlers which are responsible for logging to a target. (e.g. there are already handlers for logging to streams, files or even the network builtin). We would need to use (write) a handler that logs to a database. A quick search shows that has already been done for sqlite. So that shouldn't be a big problem.
    The api call would then just be a db query.

A bit of self-promotion, but maybe it's something you find useful: I have written some code that lets you simplify the logging process (especially in object oriented programming). For example inheriting classes can use self.debug()/self.info(),... and the class is the logger name (optionally an id). It can also add the function name where the log statement was called from.
The package is called flotils (not very creative on my part) and a detailed example is in the docs
[end of self promo]

from paperless.

danielquinn avatar danielquinn commented on July 23, 2024

Well I'm feeling like death today, but later this week I'll take a look at these links and work something out. Thanks for the input!

from paperless.

danielquinn avatar danielquinn commented on July 23, 2024

I've now totally overhauled the logging system, making proper use of the Python's logging module.

from paperless.

stueja avatar stueja commented on July 23, 2024

Hi,
is it possbile to turn the logging of served thumbnails off? Loading the "Documents" page causes a lot of logging messages like

Jan 22 11:45:51 brick python[466]: [22/Jan/2019 11:45:51] "GET /fetch/thumb/311 HTTP/1.0" 200 42941

Thanks,
Jan

from paperless.

danielquinn avatar danielquinn commented on July 23, 2024

Not that I know of. The thumbnails (and documents) are all served through Django to maintain security and handle decryption (if enabled). The files can't be accessed without going through the Paperless/Django server, and so they get logged.

You might be able to fiddle with Django's LOGGING variable in settings.py, but I wouldn't know how to do it off-hand. If you figure it out though, feel free to add some documentation to the project :-)

from paperless.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.