No dependency (bundling)
Nebula Logger is MIT-licensed. If you want to ship your own package without a separate Nebula Logger install step - and are willing to own the upgrade path - bundle the metadata directly into your project.
Trade-offs
| Approach | Pro | Con |
|---|---|---|
| Optional dependency (Callable) | No coupling; customers choose whether to install. | Logging is only available in orgs that installed Nebula Logger. |
| Hard dependency | Customers get logging automatically; you can reference Logger classes directly. | Your package install fails when Nebula Logger isn’t installed. |
| Bundling | Single deployment artifact; no install-time coupling. | You own upgrades manually; no automatic updates. |
Choose bundling when you specifically need a single artifact and can absorb the maintenance cost. Otherwise, one of the other two options is easier.
Steps
- Fork or clone the Nebula Logger repo.
- Copy the
nebula-logger/core/main/directory into your own source-format project under whichever package directory you use. - Add the copied directory as a
packageDirectoriesentry in yoursfdx-project.json. - Deploy as normal:
sf project deploy start --source-dir <your-copied-path>. - Assign the shipped permission sets (
LoggerAdmin,LoggerLogViewer,LoggerEndUser,LoggerLogCreator). - Configure
LoggerSettings__cat the org default level (see Post-install setup).
Upgrading
To pull in new Nebula Logger releases:
- Diff your copied metadata against the
mainbranch or a specific release tag. - Cherry-pick the changes you want. Watch for renamed API elements, new custom fields, new CMDT records, and permission set additions.
- Deploy the delta.
- Run the Nebula Logger Apex tests to catch anything the manual copy missed.
There is no automated tooling for this. The trade-off of bundling is that upgrades become your maintenance burden.
Namespace considerations
The nebula-logger/core/main/ directory is written for the unlocked (no-namespace) package. If your own package has a namespace, the copied metadata inherits that namespace. Update any hardcoded references to Nebula. in your own code accordingly.
Where next
- Optional dependency via Callable - if you can accept optional logging.
- Hard dependency - if you want automatic upgrades.
- Getting Started - Bundle without a dependency - the same content from the getting-started view.