New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support aiologger extra attribute #3

Merged
merged 1 commit into from Jan 8, 2019

Conversation

Projects
None yet
2 participants
@thulio
Copy link
Contributor

thulio commented Jan 5, 2019

This PR aims to add compatibility with aiologger.

aiologger uses a extra attribute on LogRecord to define custom metadata.

Without this PR the output is something like:

{
    "timestamp": "2019-01-05T13:28:57.211000Z",
    "severity": "INFO",
    "message": "Persisting error message",
    "labels": {
        "type": "python-application",
        "name": "my-app",
        "version": "0.0.1"
    },
    "metadata": {
        "userLabels": {
            "flatten": true,
            "serializer_kwargs": {},
            "extra": {
                "module_name": "my_app.module",
                "payload": "PAYLOAD"
            }
        }
    },
    "sourceLocation": {
        "file": "module.py",
        "line": 12,
        "function": "function"
    }
}

With this PR:

{
    "timestamp": "2019-01-05T13:28:57.211000Z",
    "severity": "INFO",
    "message": "Persisting error message",
    "labels": {
        "type": "python-application",
        "name": "my-app",
        "version": "0.0.1"
    },
    "metadata": {
        "userLabels": {
            "module_name": "my_app.module",
            "payload": "PAYLOAD"
        }
    },
    "sourceLocation": {
        "file": "module.py",
        "line": 12,
        "function": "function"
    }
}

@rai200890 rai200890 merged commit cd35a20 into rai200890:master Jan 8, 2019

@thulio thulio deleted the thulio:feat/suport-aiologger branch Jan 10, 2019

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