spring-projects / spring-projects/spring-boot

Allow addition of custom logback Actions

Open
#24,992 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement
Dominant language
Java
Stars
81.5k
Forks
42.7k
Avg merge
2d 4h
Merged PRs (30d)
65

Description

Hi,

I was looking at adding a custom Action via the SpringBootJoranConfigurator but this is not currently possible.

My use case is to enable or disable an appender based on a property via the spring Environment class.

I managed to add a custom action based on the newRule extension, but its not possible to get access to the Environment class.

A way to either configure the SpringBootJoranConfigurator with the LoggingInitializationContext or a new way to enable/disable based on a property would be handy, e.g. like a <conditionalOnProperty property="my.property.enabled" havingValue="true" matchOnMissing=true />

Cheers

Andy

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading SpringBootJoranConfigurator and the LoggingInitializationContext references mentioned in the issue, then inspect how the newRule extension is handled. Determine whether custom Actions should receive the logging context or whether a property-based conditional action is the intended direction. Done means one supported approach is specified and covered by the relevant logging tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
observability
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.