Skip to content
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

KERIA logs should indicate the agent that the log applies to #324

Open
2byrds opened this issue Nov 21, 2024 · 7 comments
Open

KERIA logs should indicate the agent that the log applies to #324

2byrds opened this issue Nov 21, 2024 · 7 comments

Comments

@2byrds
Copy link
Collaborator

2byrds commented Nov 21, 2024

Feature request description/rationale

Currently there is no distinction between logs per agent. Prefix the logs with the agent id.

@lenkan
Copy link
Collaborator

lenkan commented Nov 27, 2024

It would be useful if the log format was standardized throughout as well. Maybe to take inspiration from https://en.wikipedia.org/wiki/Common_Log_Format.

If we add the controller id and/or agent id, and then log every request, it would be much easier to track down certain errors.

@2byrds
Copy link
Collaborator Author

2byrds commented Dec 3, 2024

From our dev meeting, the keri logging has advanced log features to add additional fields, for instance different formatters. There might be some witness examples with formatters.

@2byrds
Copy link
Collaborator Author

2byrds commented Dec 3, 2024

Look in keripy help.tests.help.oggler class definition for examples. There is some hio compatible logger stuff. you can change the f-strings. Phil showed the example:
image
It is recommended to put the agent information in a f-string
The log module source is through hio, but keri import should be from help.

@2byrds
Copy link
Collaborator Author

2byrds commented Dec 3, 2024

From Sam during the meeting:
"ogler = ogling.initOgler(prefix='keri', syslogged=False) # inits once only on first import
This is in keri.help.init.py
so import ogler from keri.help to get prefix of 'keri'
To get a module specific prefix then import ogling from keri.help and then create a module specific ogler with a different prefix.
The reason not to import ogler from hio is so that any keri specific configuration can happen in keri.help and all keri submodules inherit that behavior."

@2byrds
Copy link
Collaborator Author

2byrds commented Jan 30, 2025

From our vLEI-dev-community call:
Ed E. noted that that GDPR could be an issue if the logs are stored indefinitely, etc. because of identifier ids/name/creds.
@kentbull sent us his recent manual log changes. Hopefully he can review the above and note to us if the Ogler suggestion from Sam can work within KERIA, per agent.
Kent three logging PRs are:
To the v1.1.30 branch: https://github.com/WebOfTrust/keripy/pull/930/files
To the v1.2.4 branch: WebOfTrust/keripy#932
To main: WebOfTrust/keripy#933
We took a look and like the additional logging information, but would like to explore agent specific logging that includes the prefix without the need to include it manually, etc.

@SmithSamuelM
Copy link
Contributor

At HP for both security and privacy reasons we had to scrub logs of all identifiers like usernames. So while its helpful for debugging including full identifiers might result in a lot of work down the road. You might consider truncating the identifiers, to something like first 4 and last 4 characters.

@kentbull
Copy link
Contributor

@SmithSamuelM yes, I truncated the identifiers to the first 8 characters, though using the first 4 and last 4 would be even better. I will change my logging PRs to reflect this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants