{"id":29482993,"url":"https://github.com/jhannes/logevents","last_synced_at":"2025-07-15T02:04:10.271Z","repository":{"id":32807987,"uuid":"140347284","full_name":"jhannes/logevents","owner":"jhannes","description":"An easy-to-extend implementation of SLF4J with batteries included and sensible defaults","archived":false,"fork":false,"pushed_at":"2025-06-12T11:37:55.000Z","size":12402,"stargazers_count":44,"open_issues_count":5,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-12T12:38:22.593Z","etag":null,"topics":["java","library","logging","slf4j"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhannes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-07-09T22:08:29.000Z","updated_at":"2025-06-12T11:37:58.000Z","dependencies_parsed_at":"2024-03-25T12:54:45.564Z","dependency_job_id":"1e240ea4-767c-49a4-bc7d-80a7f728fdeb","html_url":"https://github.com/jhannes/logevents","commit_stats":{"total_commits":682,"total_committers":8,"mean_commits":85.25,"dds":"0.21407624633431088","last_synced_commit":"3e2c55c709257423ff24055e7c9475634e21d35d"},"previous_names":[],"tags_count":69,"template":false,"template_full_name":null,"purl":"pkg:github/jhannes/logevents","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhannes%2Flogevents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhannes%2Flogevents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhannes%2Flogevents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhannes%2Flogevents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhannes","download_url":"https://codeload.github.com/jhannes/logevents/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhannes%2Flogevents/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265024845,"owners_count":23699618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","library","logging","slf4j"],"created_at":"2025-07-15T02:04:09.684Z","updated_at":"2025-07-15T02:04:10.262Z","avatar_url":"https://github.com/jhannes.png","language":"Java","funding_links":[],"categories":["日志库"],"sub_categories":[],"readme":"# Logevents - a simple SLF4J implementation\n\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.logevents/logevents/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.logevents/logevents)\n[![Javadoc](https://img.shields.io/badge/javadoc-logevents-blue)](https://jhannes.github.io/logevents/apidocs/)\n[![Build Status](https://github.com/jhannes/logevents/workflows/Java%20CI/badge.svg)](https://github.com/jhannes/logevents/actions/workflows/delivery.yml)\n[![Coverage Status](https://coveralls.io/repos/github/jhannes/logevents/badge.svg?branch=main)](https://coveralls.io/github/jhannes/logevents?branch=main)\n[![Vulnerability scan](https://snyk.io/test/github/jhannes/logevents/badge.svg?targetFile=pom.xml)](https://snyk.io/test/github/jhannes/logevents?targetFile=pom.xml)\n\nSetting up and configuring logging should be *easy*, whether you want to do it with configuration files or in code. Log\nEvents is a small (265kb, *no dependencies*) logging framework built on top of SLF4J - the logging lingua franka for\nJava.\n\nFor detailed instructions, see [the manual](MANUAL.md).\n\n## Quick start\n\n### Add dependencies (for Maven)\n\n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eorg.slf4j\u003c/groupId\u003e\n        \u003cartifactId\u003eslf4j-api\u003c/artifactId\u003e\n        \u003cversion\u003e2.0.7\u003c/version\u003e\n    \u003c/dependency\u003e\n\n    \u003cdependency\u003e\n        \u003cgroupId\u003eorg.logevents\u003c/groupId\u003e\n        \u003cartifactId\u003elogevents\u003c/artifactId\u003e\n        \u003cversion\u003e0.5.0\u003c/version\u003e\n        \u003cscope\u003eruntime\u003c/scope\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n### Simple configuration\n\n```properties\nroot=WARN file,console\nlogger.org.example=INFO\nlogger.org.example.myapp=DEBUG,TRACE@marker=HTTP_REQUEST\u0026mdc:user=admin\nlogevents.status=CONFIG\n```\n\nBy default, the [`file`](https://jhannes.github.io/logevents/apidocs/org/logevents/observers/FileLogEventObserver.html) observer will log to a file named `logs/your-app-name-%date.log` and [`console`](https://jhannes.github.io/logevents/apidocs/org/logevents/observers/ConsoleLogEventObserver.html) logs ANSI-colored logs to the console.\n\nThe default level for loggers with this configuration will be `WARN`, by `org.example` will log at `INFO` and `org.example.myapp` will log at `DEBUG`, or trace for HTTP_REQUEST when the `user` is `admin`. See [LogEventFilter](https://jhannes.github.io/logevents/apidocs/org/logevents/impl/LogEventFilter.html) for details. Use level `NONE` to turn off logging.\n\nLogevents will output [configuration information](https://jhannes.github.io/logevents/apidocs/org/logevents/status/package-summary.html) to system err.\n\n### Configuration in a [Twelve-Factor](https://12factor.net/) setting\n\nHere is an example setup in a cloud environment. Logevents can be configured with environment variables and use stdout as the main channel for logging, outputting JSON logs for more powerful downstream parsing\n\n```bash\n# Output logevents configuration debug to stderr\nLOGEVENTS_STATUS=CONFIG\n# Skip sun.reflect packages in stack traces\nLOGEVENTS_PACKAGEFILTER=sun.reflect\n\n# By default only output to console at DEBUG\nLOGEVENTS_ROOT=DEBUG console\n\n# Console format should be JSON for easier log parsing\nLOGEVENTS_OBSERVER_CONSOLE_FORMATTER=ConsoleJsonLogEventFormatter\n\n# Install logging to Microsoft Teams for all ERROR messages\nLOGEVENTS_ROOT_OBSERVER_TEAMS=ERROR\nLOGEVENTS_OBSERVER_TEAMS=MicrosoftTeamsLogEventObserver\nLOGEVENTS_OBSERVER_TEAMS_URL=https://example.webhook.office.com/webhookb2/...\n\n# Turn down logging for selected packages\nLOGEVENTS_LOGGER_ORG_ECLIPSE_JETTY=WARN\n# Turn up logging to TRACE for com.example message for selected users are\nLOGEVENTS_LOGGER_COM_EXAMPLE=DEBUG,TRACE@mdc:user=superuser|admin|tester\n```\n\n\n## Features:\n\n* [Console logging](https://jhannes.github.io/logevents/apidocs/org/logevents/observers/ConsoleLogEventObserver.html)\n  with good default colors (also on Windows). Use `observer.console.format=ConsoleJsonLogEventFormatter` to output\n  single-line JSON logs, suitable for log parsing\n* [File logging](https://jhannes.github.io/logevents/apidocs/org/logevents/observers/FileLogEventObserver.html) with\n  reasonable defaults\n* [JUnit support](https://jhannes.github.io/logevents/apidocs/org/logevents/optional/junit/ExpectedLogEventsRule.html) to\n  easy assert on what is logged\n* [Email logging](https://jhannes.github.io/logevents/apidocs/org/logevents/observers/SmtpLogEventObserver.html),\n  including throttling to reduce spamming when get lots of log messages\n* [Slack](https://jhannes.github.io/logevents/apidocs/org/logevents/observers/SlackLogEventObserver.html) to send log\n  messages to you favorite chat channel\n* [Microsoft Teams](https://jhannes.github.io/logevents/apidocs/org/logevents/observers/MicrosoftTeamsLogEventObserver.html)\n* [Logging to database](https://jhannes.github.io/logevents/apidocs/org/logevents/observers/DatabaseLogEventObserver.html)\n* [Display logs on a web dashboard](https://jhannes.github.io/logevents/apidocs/org/logevents/observers/WebLogEventObserver.html)\n* [Elasticsearch](https://jhannes.github.io/logevents/apidocs/org/logevents/observers/ElasticsearchLogEventObserver.html)\n  . Logging directly to Elastic search Index API avoids edge cases when writing and parsing log files\n* [Humio](https://jhannes.github.io/logevents/apidocs/org/logevents/observers/HumioLogEventObserver.html)\n    . Logging directly to Humio via their [Elastic search Bulk API](https://library.humio.com/stable/docs/ingesting-data/log-shippers/other-log-shippers/#elasticsearch-bulk-api).\n* [Azure Application Insights](https://jhannes.github.io/logevents/apidocs/org/logevents/optional/azure/ApplicationInsightsLogEventObserver.html) (\n  requires optional com.microsoft.azure:applicationinsights-core dependency)\n* [JMX integration](https://jhannes.github.io/logevents/apidocs/org/logevents/jmx/LogEventsMBeanFactory.html) to view\n  the configuration and tweak log levels\n* [Filter loggers](https://jhannes.github.io/logevents/apidocs/org/logevents/core/LogEventFilter.html) on\n  markers and MDC values (e.g. `logger.org.example.app=INFO,DEBUG@mdc:user=superuser|admin`)\n* [Filter observers](https://jhannes.github.io/logevents/apidocs/org/logevents/core/AbstractFilteredLogEventObserver.html)\n  on markers and MDC values\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhannes%2Flogevents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhannes%2Flogevents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhannes%2Flogevents/lists"}