Skip to content

Colors not rendering in Apache WSGI logs (hashtag1026) #15

Description

@vikramsubramanian

I integrated loguru with a django application with this handler.

    dict(
        sink=sys.stderr,
        format="<g>{time:YYYY ddd MMM DD HH:mm:ss.SSSSSSZZ}</g>",
        colorize=True,
        backtrace=False, 
        diagnose=True,  
        catch=True, 
    ),

When I try to use django's inbuilt webserver to serve the application, the colors are shown just fine but for production environment, I use Apache WSGI to serve django application, the logs print fine in apache logs, but the colors are shown as codes instead of the actual color.

\x1b[32m2023 Sun Nov 26 23:44:55.622738+0000\x1b[0m - Apache Logs

![image]( - Django Development Server logs

I tested Apache Logs both on gitbash and command prompt

)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions