# IFS ECS Logger
**IFS ECS Logger** is a lightweight Python library providing **IFS-compliant structured logging** based on the **Elastic Common Schema (ECS)**. It standardizes how logs are emitted across IFS CI/CD pipelines and automation scripts, ensuring consistent observability and easy ingestion into Elasticsearch, Kibana, or any ECS-aware platform.
---
## Features It standardizes and how logs are emitted across IFS CI/CD pipelines and automation scripts
ensuring consistent observability and easy ingestion into Elasticsearch, Kibana, or any ECS-aware platform.
- **IFS ECS compliance** — follows company formatting rules (e.g., `_timestamp`, `host.name`, structured `http` objects)
- **ECS 1.6.0 compatible** — automatically includes ECS fields (`log.level`, `process.pid`, etc.)---
- **Tekton & Kubernetes context injection** — adds pipeline, task, step, pod, and namespace automatically if available
- **Structured JSON output** — perfect for Elastic, Loki, Azure Monitor, and Fluent Bit ingestion## ✨ Features
- **Log levels supported:** `debug`, `info`, `warning`, `error`, `critical`
- **Zero configuration** — simple import and use- ✅ **IFS ECS compliance** — follows company formatting rules (e.g., `_timestamp`, `host.name`, structured `http` objects)
- **ECS 1.6.0 compatible** — automatically includes ECS fields (`log.level`, `process.pid`, etc.)
---
## 📦 Installation
```bash
pip install ifs-ecs-logger
```
## Usage Example
```python
from ifs_ecs_logger import IFSLogger
# Initialize logger (Assuming the Script is fetchConfig.py)
logger = IFSLogger.get_logger("fetchConfig")
# Info - general progress updates
logger.info("Starting configuration fetch", extra={
    "hostName": "build-agent-01",
    "timestamp": "2025-10-21T12:34:56Z",
    "http": "200"
})
# Debug - detailed internal state, visible only if level=DEBUG
# (ex: logger = IFSLogger.get_logger("fetchConfig", level="DEBUG"))
logger.debug("Preparing to fetch configuration file", extra={
    "timestamp": "2025-10-21T12:34:00Z"
})
# Warning - non-critical anomalies
logger.warning("Response took longer than expected", extra={
    "timestamp": "2025-10-21T12:35:10Z",
    "http": {"status_code": 200}
})
# Error - operational failures
logger.error("API call failed", extra={
    "http": {"status_code": 500},
    "timestamp": "2025-10-21T12:35:30Z"
})
# Critical - system-level or unrecoverable errors
logger.critical("Fetch pipeline aborted", extra={
    "timestamp": "2025-10-21T12:36:00Z",
    "hostName": "build-agent-01"
})
```
## Expected Output (IFS ECS-Compliant JSON)
Each log entry will be emitted as structured JSON like:
```json
{
  "_timestamp": "2025-10-21T12:34:56Z",
  "log.level": "info",
  "message": "Starting configuration fetch",
  "ecs.version": "1.6.0",
  "service.name": "fetchConfig",
  "host": { "name": "build-agent-01" },
  "http": { "response": { "status_code": 200 } }
}
```
---
## IFS Compliance
This logger is designed to comply with IFS logging policies:
### Forbidden Fields
The following fields are automatically filtered out to avoid compliance issues:
- `kubernetes` (contains sensitive cluster information)
- `_id`, `_index`, `_score` (Elasticsearch internal fields)
- `stream` (duplicate information)
### Normalized Fields
- `timestamp` → `_timestamp` (IFS standard)
- `hostName` → `host.name` (nested structure)
- HTTP fields are structured as nested objects
---
## Requirements
- Python 3.8+
- `ecs-logging>=2.1.0`
- `python-json-logger>=2.0.7`
---
## License
MIT License © IFS Golden CI Team
            
         
        Raw data
        
            {
    "_id": null,
    "home_page": null,
    "name": "ifs-ecs-logger",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "logging, ecs, elastic, ifs, structured, tekton",
    "author": "IFS Golden CI Team",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/9d/a4/6ab77e4c1c973c9558fc1771419ff117e786abcd3ac438a6ffa1e1b8c241/ifs_ecs_logger-0.1.2.tar.gz",
    "platform": null,
    "description": "# IFS ECS Logger\n\n**IFS ECS Logger** is a lightweight Python library providing **IFS-compliant structured logging** based on the **Elastic Common Schema (ECS)**. It standardizes how logs are emitted across IFS CI/CD pipelines and automation scripts, ensuring consistent observability and easy ingestion into Elasticsearch, Kibana, or any ECS-aware platform.\n\n---\n\n## Features It standardizes and how logs are emitted across IFS CI/CD pipelines and automation scripts\n\nensuring consistent observability and easy ingestion into Elasticsearch, Kibana, or any ECS-aware platform.\n\n- **IFS ECS compliance** \u2014 follows company formatting rules (e.g., `_timestamp`, `host.name`, structured `http` objects)\n\n- **ECS 1.6.0 compatible** \u2014 automatically includes ECS fields (`log.level`, `process.pid`, etc.)---\n\n- **Tekton & Kubernetes context injection** \u2014 adds pipeline, task, step, pod, and namespace automatically if available\n\n- **Structured JSON output** \u2014 perfect for Elastic, Loki, Azure Monitor, and Fluent Bit ingestion## \u2728 Features\n\n- **Log levels supported:** `debug`, `info`, `warning`, `error`, `critical`\n\n- **Zero configuration** \u2014 simple import and use- \u2705 **IFS ECS compliance** \u2014 follows company formatting rules (e.g., `_timestamp`, `host.name`, structured `http` objects)\n\n- **ECS 1.6.0 compatible** \u2014 automatically includes ECS fields (`log.level`, `process.pid`, etc.)\n\n---\n\n## \ud83d\udce6 Installation\n\n```bash\n\npip install ifs-ecs-logger\n\n```\n\n## Usage Example\n\n```python\n\nfrom ifs_ecs_logger import IFSLogger\n\n# Initialize logger (Assuming the Script is fetchConfig.py)\nlogger = IFSLogger.get_logger(\"fetchConfig\")\n\n# Info - general progress updates\nlogger.info(\"Starting configuration fetch\", extra={\n    \"hostName\": \"build-agent-01\",\n    \"timestamp\": \"2025-10-21T12:34:56Z\",\n    \"http\": \"200\"\n})\n\n# Debug - detailed internal state, visible only if level=DEBUG\n# (ex: logger = IFSLogger.get_logger(\"fetchConfig\", level=\"DEBUG\"))\nlogger.debug(\"Preparing to fetch configuration file\", extra={\n    \"timestamp\": \"2025-10-21T12:34:00Z\"\n})\n\n# Warning - non-critical anomalies\nlogger.warning(\"Response took longer than expected\", extra={\n    \"timestamp\": \"2025-10-21T12:35:10Z\",\n    \"http\": {\"status_code\": 200}\n})\n\n# Error - operational failures\nlogger.error(\"API call failed\", extra={\n    \"http\": {\"status_code\": 500},\n    \"timestamp\": \"2025-10-21T12:35:30Z\"\n})\n\n# Critical - system-level or unrecoverable errors\nlogger.critical(\"Fetch pipeline aborted\", extra={\n    \"timestamp\": \"2025-10-21T12:36:00Z\",\n    \"hostName\": \"build-agent-01\"\n})\n```\n\n## Expected Output (IFS ECS-Compliant JSON)\n\nEach log entry will be emitted as structured JSON like:\n\n```json\n{\n  \"_timestamp\": \"2025-10-21T12:34:56Z\",\n  \"log.level\": \"info\",\n  \"message\": \"Starting configuration fetch\",\n  \"ecs.version\": \"1.6.0\",\n  \"service.name\": \"fetchConfig\",\n  \"host\": { \"name\": \"build-agent-01\" },\n  \"http\": { \"response\": { \"status_code\": 200 } }\n}\n```\n\n---\n\n## IFS Compliance\n\nThis logger is designed to comply with IFS logging policies:\n\n### Forbidden Fields\nThe following fields are automatically filtered out to avoid compliance issues:\n- `kubernetes` (contains sensitive cluster information)\n- `_id`, `_index`, `_score` (Elasticsearch internal fields)\n- `stream` (duplicate information)\n\n### Normalized Fields\n- `timestamp` \u2192 `_timestamp` (IFS standard)\n- `hostName` \u2192 `host.name` (nested structure)\n- HTTP fields are structured as nested objects\n\n---\n\n## Requirements\n\n- Python 3.8+\n- `ecs-logging>=2.1.0`\n- `python-json-logger>=2.0.7`\n\n---\n\n## License\n\nMIT License \u00a9 IFS Golden CI Team\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "IFS-compliant ECS structured logger for CI/CD pipelines",
    "version": "0.1.2",
    "project_urls": null,
    "split_keywords": [
        "logging",
        " ecs",
        " elastic",
        " ifs",
        " structured",
        " tekton"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bd71d2cbcf27afa9579ca45cac32048898b134ff63d2d30b1739f11ad1967915",
                "md5": "54e91d7de34ca180f6ce3960ebb7c301",
                "sha256": "3d80579d7e6d042d940d27b07eced571e301739f56924b08214e95d0e0cbd45f"
            },
            "downloads": -1,
            "filename": "ifs_ecs_logger-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "54e91d7de34ca180f6ce3960ebb7c301",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6878,
            "upload_time": "2025-10-21T13:54:14",
            "upload_time_iso_8601": "2025-10-21T13:54:14.737686Z",
            "url": "https://files.pythonhosted.org/packages/bd/71/d2cbcf27afa9579ca45cac32048898b134ff63d2d30b1739f11ad1967915/ifs_ecs_logger-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9da46ab77e4c1c973c9558fc1771419ff117e786abcd3ac438a6ffa1e1b8c241",
                "md5": "5533d60257a09c22e92d9677e95bb347",
                "sha256": "5db9f4b6d394b1e0766a0961713c52a3a997c09f6605b8833c7c9b4299aefa58"
            },
            "downloads": -1,
            "filename": "ifs_ecs_logger-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "5533d60257a09c22e92d9677e95bb347",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 5492,
            "upload_time": "2025-10-21T13:54:15",
            "upload_time_iso_8601": "2025-10-21T13:54:15.978155Z",
            "url": "https://files.pythonhosted.org/packages/9d/a4/6ab77e4c1c973c9558fc1771419ff117e786abcd3ac438a6ffa1e1b8c241/ifs_ecs_logger-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-21 13:54:15",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "ifs-ecs-logger"
}