12 Commits

Author SHA1 Message Date
Christophe Bliard 88f9772b23 Make grape logging grokable by our logging instrumentation
Our grok pattern is something like this:
....%{SPACE}\[%{DATA:namespace}\]%{SPACE}method=%{WORD:http_method}...

The parsing works for logs generated by lograge which look like this:

```
I, [2025-09-22T13:31:21.045328 #47]  INFO -- : [51a28da6-d112-45d9-b5fd-ba2f2c86fbba] [trace_id=2f2ce94953e0b1188c47eabfdd4d5b08] [span_id=1aa8769d2ed98fc6] [public] method=GET path=/health_checks/default format=*/* controller=OkComputer::OkComputerController action=show status=200 allocations=860 duration=2.47 view=0.15 db=0.00 user=3 domain= namespace=public shard=
```

But fails to parse for logs generated by grape loggin, which look like this:
```
I, [2025-09-22T12:15:22.139783 #55]  INFO -- : [6878233d-b216-4f6e-a039-6f67f2c99684] [trace_id=af9a3f2a8d129f5603522c9a9e0e7599] [span_id=1f43864c812ab072] [instance_1450094160_7477212_4176] duration=8384.68 db=1008.17 view=7376.51 status=200 method=GET path=/api/v3/queries/3687 params={\"pageSize\" => \"100\"} host=qa.openproject-edge.com request_id=6878233d-b216-4f6e-a039-6f67f2c99684 user=344 domain=qa.openproject-edge.com namespace=instance_1450094160_7477212_4176 shard=
```

The parsing fails because `duration` is the field after `namespace`, and
our pattern expects `method` instead.

This commit reorders the fields in the grape logging logs so that
`method` and `path` appear first, as in lograge logs for controller
actions.
2025-09-22 18:00:01 +02:00
Alexander Brandon Coles 3eeb5abfab Fix missing copyright notices in config 2025-08-19 17:40:34 +01:00
Alexander Brandon Coles 78ed9ea580 Freeze string literals in config
rubocop -A --only Style/FrozenStringLiteralComment,Layout/EmptyLineAfterMagicComment,Style/RedundantFreeze config
2025-08-19 17:04:00 +01:00
ulferts 3b2121f733 Revert "Merge remote-tracking branch 'origin/release/13.4' into dev"
This reverts commit 40b2bbeb09, reversing
changes made to b4c6cb17cc.
2024-03-21 11:31:17 +01:00
Ivan Kuchin 7787e457a3 Revert "Merge branch 'dev' into release/13.4"
This reverts commit a901541269, reversing
changes made to e573ca00b7.
2024-03-20 20:19:08 +01:00
Ivan Kuchin 9e4934cd0a change quotes using rubocop --only Style/StringLiterals,Style/QuotedSymbols -a 2024-03-20 18:05:22 +01:00
Dombi Attila ba16112745 Use Rails.application instead of OpenProject::Application 2024-02-01 14:22:04 +02:00
Oliver Günther 15a7e5e9bb Extend payload also for grape logging 2021-11-03 16:34:50 +01:00
Oliver Günther 41bd0dbd5a Avoid Hash#delete on input 2021-09-17 14:47:48 +02:00
Oliver Günther d748b967dd Fix using log extenders from sentry and core logger 2021-09-17 14:06:28 +02:00
Oliver Günther 3f0cf60d06 Allow logging with json formatter 2021-09-17 12:48:36 +02:00
Oliver Günther f98e50ccf6 Enable basic request logging for grape 2021-09-17 10:45:05 +02:00