Skip to content

Conversation

@KevLehman
Copy link
Member

@KevLehman KevLehman commented Jan 20, 2026

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Chores
    • Improved internal logging infrastructure by standardizing error and message logging to use structured object formats across multiple services. These technical improvements enhance system observability for developers and administrators without affecting user-facing functionality.

✏️ Tip: You can customize this high-level summary in your review settings.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Jan 20, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is targeting the wrong base branch. It should target 8.2.0, but it targets 8.1.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Jan 20, 2026

⚠️ No Changeset found

Latest commit: f002112

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 20, 2026

Walkthrough

This PR standardizes logging across multiple server modules by converting string-based log calls to structured object payloads and normalizing catch parameter names from e to err. No functional changes to control flow or business logic are introduced.

Changes

Cohort / File(s) Summary
API Endpoints
apps/meteor/app/api/server/v1/emoji-custom.ts, apps/meteor/app/api/server/v1/ldap.ts, apps/meteor/app/api/server/v1/misc.ts
Converted error logging from string format to structured objects; renamed catch variables to err; preserved error handling semantics
Authentication & Login
apps/meteor/app/authentication/server/lib/logLoginAttempts.ts
Changed login failure logging from formatted string to structured object { msg, user, clientAddress, forwardedFor, realIp, userAgent }
Cloud Services
apps/meteor/app/cloud/server/index.ts
Standardized three catch blocks to log errors as { msg, err } instead of string messages; renamed e to err throughout
User Management
apps/meteor/app/crowd/server/crowd.ts
Consolidated error logging to single structured entry with { msg, err } instead of separate debug/error logs
File Upload & Storage
apps/meteor/app/file-upload/server/methods/sendFileMessage.ts, apps/meteor/app/file-upload/ufs/AmazonS3/server.ts, apps/meteor/app/file-upload/ufs/GoogleStorage/server.ts, apps/meteor/app/file-upload/ufs/Webdav/server.ts
Converted error logging to structured objects; renamed catch parameter from error/e to err
Importer
apps/meteor/app/importer/server/classes/converters/MessageConverter.ts
Consolidated error handling logs into single structured { msg, err } entries; updated debug log format to { msg, importId }
Integrations
apps/meteor/app/integrations/server/lib/triggerHandler.ts, apps/meteor/server/services/omnichannel-integrations/providers/twilio.ts
Changed warning/error logs from strings to structured objects with context fields
Settings Management
apps/meteor/app/settings/server/CachedSettings.ts, apps/meteor/app/settings/server/SettingsRegistry.ts
Converted warning/error logs to structured format with { msg, _id, ...err } payloads
Livechat Enterprise Hooks
apps/meteor/ee/app/livechat-enterprise/server/hooks/afterOnHold.ts, apps/meteor/ee/app/livechat-enterprise/server/hooks/afterOnHoldChatResumed.ts, apps/meteor/ee/app/livechat-enterprise/server/hooks/checkAgentBeforeTakeInquiry.ts, apps/meteor/ee/app/livechat-enterprise/server/hooks/resumeOnHold.ts
Converted debug/error logs from string templates to structured objects with relevant context fields
LDAP Manager
apps/meteor/server/lib/ldap/Manager.ts
Changed authentication logging from template strings to { msg, dn } structured objects
Streamer Module
apps/meteor/server/modules/streamer/streamer.module.ts
Converted invalid shortcut warning to structured log { msg, name, fn }
Omnichannel Analytics & Queue
apps/meteor/server/services/omnichannel-analytics/service.ts, apps/meteor/server/services/omnichannel/queue.ts
Standardized multiple validation error logs and queue debug messages to structured format with context fields; removed one test assertion
Migrations
apps/meteor/server/startup/migrations/v317.ts
Converted three warning logs to structured objects; each now includes msg, _id, and relevant update context
Federation
ee/packages/federation-matrix/src/setup.ts
Changed domain validation error logs from string interpolation to { msg, domain } objects
License
ee/packages/license/src/license.ts
Simplified error logging by consolidating to single structured entry with { encryptedLicense, err }
Queue Worker
ee/packages/omnichannel-services/src/QueueWorker.ts
Converted all log calls to structured format; added contextual fields like msg, queueItemId, to, err
Apps Engine Runtime
packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts
Converted restart flow logs to structured objects with msg field; updated error payload from { error } to { err }

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

The changes follow a single, consistent pattern across 25+ files (string-based logging → structured object logging), making each individual file trivial to review. However, the scope is substantial and includes multiple module areas requiring verification of pattern consistency. The homogeneous nature of changes reduces cognitive load compared to heterogeneous edits.

Possibly related PRs

Suggested labels

logging, refactor, stat: ready to merge

Suggested reviewers

  • sampaiodiego
  • ggazzo
  • d-gubert

Poem

🐰 Hop hop, the logs are structured now,
No more strings, just objects—oh how!
err stands tall where e once sat,
Organized chaos in a hat. 🎩

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adapting logs throughout the codebase to use structured object format instead of string interpolation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/logs-almost

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@KevLehman KevLehman changed the title more files chore: Adapt logs to object format (almost) Jan 20, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 20, 2026

📦 Docker Image Size Report

➡️ Changes

Service Current Baseline Change Percent
sum of all images 0B 0B 0B
account-service 0B 0B 0B
authorization-service 0B 0B 0B
ddp-streamer-service 0B 0B 0B
omnichannel-transcript-service 0B 0B 0B
presence-service 0B 0B 0B
queue-worker-service 0B 0B 0B
rocketchat 0B 0B 0B

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/18 22:53", "11/19 23:02", "11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 23:01", "12/02 21:57", "12/03 21:00", "12/04 18:17", "12/05 21:56", "12/08 20:15", "12/09 22:17", "12/10 23:26", "12/11 21:56", "12/12 22:45", "12/13 01:34", "12/15 22:31", "12/16 22:18", "12/17 21:04", "12/18 23:12", "12/19 23:27", "12/20 21:03", "12/22 18:54", "12/23 16:16", "12/24 19:38", "12/25 17:51", "12/26 13:18", "12/29 19:01", "12/30 20:52", "01/21 17:40 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.00]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.00]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.00]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.00]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.00]
  line "queue-worker-service" [0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.00]
  line "rocketchat" [0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.00]
Loading

Statistics (last 30 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.4GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 0B
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-38280
  • Baseline: develop
  • Timestamp: 2026-01-21 17:40:14 UTC
  • Historical data points: 30

Updated: Wed, 21 Jan 2026 17:40:15 GMT

Base automatically changed from chore/logs-again to develop January 20, 2026 21:08
@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

❌ Patch coverage is 29.62963% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.73%. Comparing base (eb5a1ef) to head (f002112).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #38280      +/-   ##
===========================================
- Coverage    70.74%   70.73%   -0.02%     
===========================================
  Files         3142     3142              
  Lines       108929   108926       -3     
  Branches     19631    19754     +123     
===========================================
- Hits         77064    77047      -17     
- Misses       29865    29872       +7     
- Partials      2000     2007       +7     
Flag Coverage Δ
e2e 60.26% <ø> (-0.10%) ⬇️
e2e-api 48.03% <35.29%> (ø)
unit 71.88% <28.57%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@KevLehman KevLehman marked this pull request as ready for review January 21, 2026 17:11
@KevLehman KevLehman requested review from a team as code owners January 21, 2026 17:11
@KevLehman KevLehman added this to the 8.2.0 milestone Jan 21, 2026
@KevLehman KevLehman added the stat: QA assured Means it has been tested and approved by a company insider label Jan 21, 2026
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Jan 21, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 29 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts">

<violation number="1" location="packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts:322">
P2: Wrapping the caught error in `new Error(...)` discards the original stack/cause, making logs less useful. Log the original Error when available and only create a new Error for non-Error values.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@ee/packages/license/src/license.ts`:
- Around line 355-360: The catch block in the license verification flow logs the
sensitive encryptedLicense payload (see the logger.error call); remove
encryptedLicense from the structured log and instead log only non-sensitive data
such as the error (err) and optionally a non-reversible identifier (e.g., a
SHA-256 hex/hash of encryptedLicense) if you need correlation; update the
logger.error invocation in the catch that currently references encryptedLicense
so it only includes err and an optional safe hash (calculate the hash in the
same scope before logging).

In `@ee/packages/omnichannel-services/src/QueueWorker.ts`:
- Around line 90-93: The log message in QueueWorker.ts incorrectly hardcodes "10
seconds"; update the logger.info in the retry branch (where
queueItem.retryCount, this.retryCount and this.isRetryableError are checked) to
report the actual configured delay (this.retryDelay) instead of "10 seconds" —
e.g., compute and include the delay value (milliseconds or seconds) derived from
this.retryDelay in the message so operators see the true retry delay.

In `@packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts`:
- Around line 321-323: In the catch block inside AppsEngineDenoRuntime (where
logger.error is called with "Failed to restart app's subprocess"), stop wrapping
the caught exception with new Error(...) which discards the original stack;
instead pass the original error object to logger.error (e.g., err: e or err: e
instanceof Error ? e : new Error(String(e))) so the original stack trace is
preserved, and then rethrow the original error as currently done.
🧹 Nitpick comments (1)
apps/meteor/server/services/omnichannel-integrations/providers/twilio.ts (1)

263-266: Inconsistent logging format.

This error log still uses a template string format while the rest of this file and the PR converts logs to structured object format. Consider updating for consistency:

Suggested fix
-			SystemLogger.error(`(Twilio) -> URL or Twilio token not configured.`);
+			SystemLogger.error({ msg: '(Twilio) -> URL or Twilio token not configured.' });

@kodiakhq kodiakhq bot merged commit 25271b2 into develop Jan 21, 2026
44 checks passed
@kodiakhq kodiakhq bot deleted the chore/logs-almost branch January 21, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants