Skip to content

Conversation

@saltytostitos
Copy link
Contributor

This PR adds a likely niche enhancement to allow nesting the log data when logging json.

With systems like Cloudflare Observability, that dump tons of logging data, this makes it easy for me to digest and query the data that I'm providing.

config:

"evlog": {
    "inset": "evlog"
}

Current flat logs

{
"timestamp": "...",
"level": "...",
"service": "...",
...
}

With inset: "evlog":

{
"$evlog": {
    "timestamp": "...",
    "level": "...",
    "service": "...",
    ...
    },
"$metadata": {
// ...cloudflareData
    {
}
image
  • Updated config, types
  • Agents
  • Docs

I don't normally public formal PRs so if you're interested in this one, let me know if there's anything you need.

Add feature to allow nesting evlog data into another property
@vercel
Copy link

vercel bot commented Feb 5, 2026

@saltytostitos is attempting to deploy a commit to the HRCD Projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link

github-actions bot commented Feb 5, 2026

Thank you for following the naming conventions! 🙏

@saltytostitos saltytostitos marked this pull request as draft February 5, 2026 21:18
Copy link
Contributor Author

@saltytostitos saltytostitos left a comment

Choose a reason for hiding this comment

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

Accidentally snuck in another change that shouldn't have been here. Removed this change for another PR.

nitro/plugin.ts

@saltytostitos saltytostitos marked this pull request as ready for review February 5, 2026 21:20
@HugoRCD HugoRCD requested a review from Copilot February 6, 2026 15:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an inset configuration option to evlog that allows nesting log data under a custom property (automatically prefixed with $). This feature is designed for observability platforms like Cloudflare Workers that inject their own root-level metadata, making it easier to separate application logs from platform metadata.

Changes:

  • Added inset config option to type definitions, allowing users to specify a property name for nesting logs
  • Implemented inset logic in the logger that wraps log data when pretty: false and inset is configured
  • Updated documentation across multiple files explaining the feature, use cases, and platform compatibility warnings

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
packages/evlog/src/types.ts Added inset property to LoggerConfig and defined InsetWideEvent type
packages/evlog/src/logger.ts Implemented inset logic to conditionally nest log data and added global inset variable
packages/evlog/src/nuxt/module.ts Added inset option to Nuxt module configuration with detailed JSDoc
packages/evlog/src/nitro/plugin.ts Added inset config to Nitro plugin interface and initialization
packages/evlog/src/index.ts Exported InsetWideEvent type for public API
skills/evlog/references/wide-events.md Added comprehensive documentation section with examples and important considerations
skills/evlog/references/code-review.md Added code review checklist item for verifying proper inset usage
skills/evlog/SKILL.md Added inset feature documentation and code review guidance
apps/docs/content/1.getting-started/2.installation.md Added installation guide section with configuration examples and warnings
README.md Added inset feature documentation with examples
AGENTS.md Added inset config option to agent reference table
bun.lock Automated lockfile update adding configVersion field

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 6, 2026

npm i https://pkg.pr.new/evlog@42

commit: 456d39f

@saltytostitos saltytostitos marked this pull request as draft February 10, 2026 01:16
:)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@saltytostitos
Copy link
Contributor Author

☑️ Merged w/upstream.
☑️ Cleaned up diff, fixed typos 🥇
☑️ Added tests w/passes

Should be a much cleaner diff now. Sorry about all the GH actions!!! I believe I got everything.

@saltytostitos saltytostitos marked this pull request as ready for review February 10, 2026 01:46
@@ -1,4 +1,5 @@
import type { EnvironmentContext, Log, LogLevel, LoggerConfig, RequestLogger, RequestLoggerOptions, SamplingConfig, TailSamplingContext, WideEvent } from './types'
import { defu } from 'defu'
Copy link
Owner

Choose a reason for hiding this comment

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

I made sure that the project no longer has dependencies. Could you replace that with the deep merge function from the repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants