{
  "id": "log",
  "title": "Log",
  "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/log/",
  "summary": "Writes a log message to the Redis log file.",
  "tags": [
    "docs",
    "operate",
    "stack"
  ],
  "last_updated": "2026-04-22T11:55:45+02:00",
  "page_type": "content",
  "content_hash": "2ca5a9fb93ab89a11fd1401151c3ea6d98d555b17a21c75aad0b54d75784602b",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "[code example]\n\nWrites a log message to the Redis log file. If you do not specify a `LogLevel`, it will default to `NOTICE`."
    },
    {
      "id": "parameters",
      "title": "Parameters",
      "role": "parameters",
      "text": "| Name | Type | Description |\n|------|------|-------------|\n| msg | string | The message to write to the log |\n| level | LogLevel | The log level (DEBUG, NOTICE, VERBOSE, WARNING) |"
    },
    {
      "id": "returns",
      "title": "Returns",
      "role": "returns",
      "text": "None"
    },
    {
      "id": "example",
      "title": "Example",
      "role": "example",
      "text": "[code example]"
    }
  ],
  "examples": [
    {
      "id": "overview-ex0",
      "language": "java",
      "code": "public static void log​(java.lang.String msg)\n\npublic static void log​(java.lang.String msg, LogLevel level)",
      "section_id": "overview"
    },
    {
      "id": "example-ex0",
      "language": "java",
      "code": "GearsBuilder.log(\n    \"Setting keys to expire after 1 month\", \n    LogLevel.WARNING\n);",
      "section_id": "example"
    }
  ]
}
