Giter Club home page Giter Club logo

Comments (5)

vncloudsco avatar vncloudsco commented on September 3, 2024

I found the error information I found error information when I run journalctl command.
image

now i need to save these logs to file, is there any solution to solve this problem?

from coraza-caddy.

jptosso avatar jptosso commented on September 3, 2024

Hey, coraza-caddy uses the caddy error handler, please refer to https://caddyserver.com/docs/caddyfile/directives/log

from coraza-caddy.

vncloudsco avatar vncloudsco commented on September 3, 2024

dear: @jptosso
i tried but it doesn't seem to work with realtime log from app when i run as service. I used the solution to configure the service file as follows

# caddy.service
#
# For using Caddy with a config file.
#
# Make sure the ExecStart and ExecReload commands are correct
# for your installation.
#
# See https://caddyserver.com/docs/install for instructions.
#
# WARNING: This service does not use the --resume flag, so if you
# use the API to make changes, they will be overwritten by the
# Caddyfile next time the service is restarted. If you intend to
# use Caddy's API to configure it, add the --resume flag to the
# `caddy run` command or use the caddy-api.service file instead.

[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
#After=network.target network-online.target
Requires=network-online.target

[Service]
Type=notify
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile --force
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
StandardOutput=append:/home/caddy/log/xxxxxxxxxx.error
StandardError=append:/home/caddy/log/xxxxxxxxxx.error
[Install]
WantedBy=multi-user.target

I config StandardOutput and StandardError

I realize it's not really a good solution yet

from coraza-caddy.

jptosso avatar jptosso commented on September 3, 2024

Hey sorry for the super late reply, but this is the working config I use for error logs:

{
    log {
        format console
        output file /logs/errors.log
        level error
    }
    order coraza_waf first
}

from coraza-caddy.

github-actions avatar github-actions commented on September 3, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

from coraza-caddy.

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.