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

Add semantic logging #213

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add semantic logging #213

wants to merge 3 commits into from

Conversation

billdueber
Copy link
Collaborator

@billdueber billdueber commented Sep 26, 2024

Added rails_semantic_logger and configured rails to log :json results to STDOUT.

Tried to add remote_ip, which somehow isn't included in the standard json output.

Sample:

{
  "host": "2084e8bbbfe4",
  "application": "Semantic Logger",
  "environment": "development",
  "timestamp": "2024-09-26T01:49:13.474279Z",
  "level": "info",
  "level_index": 2,
  "pid": 1,
  "thread": "puma srv tp 001",
  "duration_ms": 486.46841700247023,
  "duration": "486.5ms",
  "named_tags": {
    "ip": "172.18.0.1"
  },
  "name": "CatalogController",
  "message": "Completed #show",
  "payload": {
    "controller": "CatalogController",
    "action": "show",
    "params": {
      "authenticity_token": "h1j+vgylJrYMC0LcLrGQb078b+FCvYeHfWeXKFHeVTOznH6Ah9zeUhSeXDud4VvGjJKx/+H2SxZiGEtdTl2qKQ==",
      "redirect": "/m/middle-english-dictionary/dictionary/MED124",
      "counter": "4",
      "search_id": "28",
      "id": "MED124"
    },
    "format": "HTML",
    "method": "POST",
    "path": "/m/middle-english-dictionary/dictionary/MED124/track",
    "status": 200,
    "view_runtime": 443.07,
    "db_runtime": 2.44,
    "status_message": "OK"
  }
}

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

Successfully merging this pull request may close these issues.

1 participant