{"id":28548467,"url":"https://github.com/faelmori/logz","last_synced_at":"2025-07-02T15:30:47.372Z","repository":{"id":280192784,"uuid":"938239195","full_name":"rafa-mori/logz","owner":"rafa-mori","description":"Logz - Simplified logging solution for Go developers, now available as both a module and a standalone executable.","archived":false,"fork":false,"pushed_at":"2025-06-21T13:03:25.000Z","size":5496,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-21T13:42:06.921Z","etag":null,"topics":["devtools","golang","logger","logging","logs","monitoring","prometheus"],"latest_commit_sha":null,"homepage":"https://github.com/faelmori/logz","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rafa-mori.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"support/build.sh","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-24T16:32:49.000Z","updated_at":"2025-06-21T13:03:28.000Z","dependencies_parsed_at":"2025-04-30T13:58:11.217Z","dependency_job_id":"99885ce4-d457-4643-ab98-b40f172f16e4","html_url":"https://github.com/rafa-mori/logz","commit_stats":null,"previous_names":["faelmori/logz"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/rafa-mori/logz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafa-mori%2Flogz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafa-mori%2Flogz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafa-mori%2Flogz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafa-mori%2Flogz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafa-mori","download_url":"https://codeload.github.com/rafa-mori/logz/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafa-mori%2Flogz/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263165663,"owners_count":23423989,"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":["devtools","golang","logger","logging","logs","monitoring","prometheus"],"created_at":"2025-06-10T01:09:57.705Z","updated_at":"2025-07-02T15:30:47.360Z","avatar_url":"https://github.com/rafa-mori.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logz Banner](docs/assets/top_banner.png)\n\n[![Build](https://github.com/rafa-mori/logz/actions/workflows/release.yml/badge.svg)](https://github.com/rafa-mori/logz/actions/workflows/release.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Go Version](https://img.shields.io/badge/go-%3E=1.21-blue)](go.mod)\n[![Releases](https://img.shields.io/github/v/release/rafa-mori/logz?include_prereleases)](https://github.com/rafa-mori/logz/releases)\n\n---\n\n**An advanced logging and metrics management tool with native support for Prometheus integration, dynamic notifications, and a powerful CLI.**\n\n---\n\n## **Table of Contents**\n1. [About the Project](#about-the-project)\n2. [Features](#features)\n3. [Installation](#installation)\n4. [Usage](#usage)\n    - [CLI](#cli)\n    - [Configuration](#configuration)\n5. [Prometheus Integration](#prometheus-integration)\n6. [Roadmap](#roadmap)\n7. [Contributing](#contributing)\n8. [Contact](#contact)\n\n---\n\n## **About the Project**\nLogz is a flexible and powerful solution for managing logs and metrics in modern systems. Built in **Go**, it provides extensive support for multiple notification methods such as **HTTP Webhooks**, **ZeroMQ**, and **DBus**, alongside seamless integration with **Prometheus** for advanced monitoring.\n\nLogz is designed to be robust, highly configurable, and scalable, catering to developers, DevOps teams, and software architects who need a centralized approach to logging, metrics and many other aspects of their systems.\n\n**Why Logz?**\n- 💡 **Ease of Use**: Configure and manage logs effortlessly.\n- 🌐 **Seamless Integration**: Easily integrates with Prometheus and other systems.\n- 🔧 **Extensibility**: Add new notifiers and services as needed.\n\n---\n\n## **Features**\n✨ **Dynamic Notifiers**:\n- Support for multiple notifiers simultaneously.\n- Centralized and flexible configuration via JSON or YAML.\n\n📊 **Monitoring and Metrics**:\n- Exposes Prometheus-compatible metrics.\n- Dynamic management of metrics with persistence support.\n\n💻 **Powerful CLI**:\n- Straightforward commands to manage logs and services.\n- Extensible for additional workflows.\n\n🔒 **Resilient and Secure**:\n- Validates against Prometheus naming conventions.\n- Distinct modes for standalone and service execution.\n\n---\n\n## **Installation**\nRequirements:\n- **Go** version 1.19 or later.\n- Prometheus (optional for advanced monitoring).\n\n```bash\n# Clone this repository\ngit clone https://github.com/rafa-mori/logz.git\n\n# Navigate to the project directory\ncd logz\n\n# Build the binary using make\nmake build\n\n# Install the binary using make\nmake install\n\n# (Optional) Add the binary to the PATH to use it globally\nexport PATH=$PATH:$(pwd)\n```\n\n---\n\n## **Usage**\n\n### CLI\nHere are some examples of commands you can execute with Logz’s CLI:\n\n```bash\n# Log at different levels\nlogz info --msg \"Starting the application.\"\nlogz error --msg \"Database connection failed.\"\n\n# Start the detached service\nlogz start  \n\n# Stop the detached service\nlogz stop  \n\n# Watch logs in real-time\nlogz watch\n```\n\n### **Usage Examples**\n\nHere are some practical examples of how to use `logz` to log messages and enhance your application's logging capabilities:\n\n#### **1. Log a Debug Message with Metadata**\n\n```bash\nlogz debug \\\n--msg 'Just an example for how it works and show logs with this app.. AMAZING!! Dont you think?' \\\n--output \"stdout\" \\\n--metadata requestId=12345,user=admin\n```\n\n**Output:**\n\n```plaintext\n[2025-03-02T04:09:16Z] 🐛 DEBUG - Just an example for how it works and show logs with this app.. AMAZING!! Dont you think?\n                     {\"requestId\":\"12345\",\"user\":\"admin\"}\n```\n\n#### **2. Log an Info Message to a File**\n\n```bash\nlogz info \\\n--msg \"This is an information log entry!\" \\\n--output \"/path/to/logfile.log\" \\\n--metadata sessionId=98765,location=server01\n```\n\n#### **3. Log an Error Message in JSON Format**\n\n```bash\nlogz error \\\n--msg \"An error occurred while processing the request\" \\\n--output \"stdout\" \\\n--format \"json\" \\\n--metadata errorCode=500,details=\"Internal Server Error\"\n```\n\n**Output (JSON):**\n\n```json\n{\n  \"timestamp\": \"2025-03-02T04:10:52Z\",\n  \"level\": \"ERROR\",\n  \"message\": \"An error occurred while processing the request\",\n  \"metadata\": {\n    \"errorCode\": 500,\n    \"details\": \"Internal Server Error\"\n  }\n}\n```\n\n---\n\n#### The image below shows the CLI in action, demonstrating how to log messages at different levels and formats:\n\n![img.png](docs/assets/cli_print.png)\n\n---\n\n### **Description of Commands and Flags**\n- **`--msg`**: Specifies the log message.\n- **`--output`**: Defines where to output the log (`stdout` for console or a file path).\n- **`--format`**: Sets the format of the log (e.g., `text` or `json`).\n- **`--metadata`**: Adds metadata to the log entry in the form of key-value pairs.\n\n---\n\n### Configuration\nLogz uses a JSON or YAML configuration file to centralize its setup. The file is automatically generated on first use or can be manually configured at:  \n`~/.kubex/logz/config.json`.\n\n**Example Configuration**:\n```json\n{\n  \"port\": \"2112\",\n  \"bindAddress\": \"0.0.0.0\",\n  \"logLevel\": \"info\",\n  \"notifiers\": {\n    \"webhook1\": {\n      \"type\": \"http\",\n      \"webhookURL\": \"https://example.com/webhook\",\n      \"authToken\": \"your-token-here\"\n    }\n  }\n}\n```\n\n---\n\n## **Prometheus Integration**\nOnce started, Logz exposes metrics at the endpoint:\n```\nhttp://localhost:2112/metrics\n```\n\n**Example Prometheus Configuration**:\n```yaml\nscrape_configs:\n  - job_name: 'logz'\n    static_configs:\n      - targets: ['localhost:2112']\n```\n\n---\n\n## **Roadmap**\n🔜 **Upcoming Features**:\n- Support for additional notifier types (e.g., Slack, Discord, and email).\n- Integrated monitoring dashboard.\n- Advanced configuration with automated validation.\n\n---\n\n## **Contributing**\nContributions are welcome! Feel free to open issues or submit pull requests. Check out the [Contributing Guide](docs/CONTRIBUTING.md) for more details.\n\n---\n\n## **Contact**\n💌 **Developer**:  \n[Rafael Mori](mailto:faelmori@gmail.com)\n💼 [Follow me on GitHub](https://github.com/rafa-mori)\nI'm open to new work opportunities and collaborations. If you find this project interesting, don’t hesitate to reach out!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaelmori%2Flogz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaelmori%2Flogz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaelmori%2Flogz/lists"}