-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add logging #2
Add logging #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
occurred: new Date().toISOString(), | ||
subject: shl?.userId, | ||
agent: { | ||
ip_address: context.request.ip, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daniellrgn I'm finding that this is showing an internal network IP address (172.18.0.6). I had this same issue in cpro, @ivan-c suggested apache's HTTP_X_REAL_IP, which worked there. I don't know if you need something specific to traefik, or... I see some references to X-Forwarded-For
https://stackoverflow.com/a/66003548 , and X-Real-IP
... I don't see this as a blocker for today's release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this in the most recent commit here, just had to flip a proxy setting. Now seeing my IP:
"agent":{"ip_address":"10.102.36.230",
server/routers/api.ts
Outdated
|
||
function log(context: oak.Context, msg: types.LogMessageSimple, shl?: types.HealthLink) { | ||
let logMessage: types.LogMessage = { | ||
version: "2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daniellrgn this is supposed to be the version of the logserver schema, which is 3.0
(see here).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, missed that header. Fixed.
Add log function to output messages to server std out
Add log endpoint for client logging