Skip to content

lua m.log(2, "4444") where is the log message? #3035

Closed
owasp-modsecurity/documentation
#7

Description

@leveryd
docker run --privileged --rm -ti owasp/modsecurity-crs:3.3.5-nginx-alpine-202401080101

/etc/modsecurity.d # grep SecRule setup.conf
SecRuleScript "/tmp/2.lua" "id:23333,deny"

/etc/modsecurity.d/owasp-crs # cat /tmp/2.lua
function main()
    --error("4444")
    --print("4444")
    m.log(1,"4444")
    m.log(2,"4444")
    return nil;
end

I am sure lua script have been exectued, but i checked "console output"、"nginx error log", and can not found the log message "4444".

So where is the log message?

coreruleset/modsecurity-crs-docker#185

Activity

  1. fzipi commented on Oct 12, 2026

    @fzipi
    Collaborator

    Revisiting this one. m.log(level, text) writes to the ModSecurity debug log at the given level (src/engine/lua.cc), nothing else; it never reaches the nginx error log or the console. To see it, set SecDebugLog to a file and SecDebugLogLevel to at least the level you pass.

    Let's close this one, with that sentence added to the Lua documentation.

  2. added
    3.xRelated to ModSecurity version 3.x
    documentationSomehow related to documentation
    needs decisionTriage done; a maintainer needs to make the final call
    on Oct 12, 2026
  3. airween commented on Nov 1, 2026

    @airween
    Member

    Thanks @fzipi,

    I sent a PR to documentation as you suggested, now closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.xRelated to ModSecurity version 3.xPlatform - NginxdocumentationSomehow related to documentationneeds decisionTriage done; a maintainer needs to make the final call

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions