Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Wrong/Missing Log Levels in application.properties #105

Merged
merged 1 commit into from
Nov 17, 2020

Conversation

angelozerr
Copy link
Contributor

@angelozerr
Copy link
Contributor Author

For Quarkus side please use the PR redhat-developer/quarkus-ls#370 too

@angelozerr angelozerr force-pushed the logger-level branch 3 times, most recently from e723eac to 94b8050 Compare November 12, 2020 13:15
@angelozerr
Copy link
Contributor Author

angelozerr commented Nov 12, 2020

This PR gives the capability to manage JUL Level with Spring Boot Metadata "hints" mechanism. The current mechanism uses https://github.com/eclipse/lsp4mp/blob/master/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/resources/org/eclipse/lsp4mp/model/values/quarkus-values-rules.json I removed this file and now Level are managed by the MicroProfile JDT instead by MicroProfile LS.

It provides several capabilities:

  1. go to the definition for Level from properties file is now available.
  2. we can add according the classpath some external Level (ex: JBoss Logging Manager adds new Level)
  3. mark some property (ex: String property) which must handle as another type (ex : quarkus.log.category.{*}.level which is a String must handle as java.util.logging.Level -> see https://github.com/redhat-developer/quarkus-ls/pull/370/files#diff-ea1c0c5a51be19a47fe421492cf810305f16548c5528e8da2933c27d8bc902c2R4

Here a demo with 1 and 2). To test it create a MicroProfile project with Open Liberty and create the following class:

package com.example.demo.resilient;

import java.util.logging.Level;

import org.eclipse.microprofile.config.inject.ConfigProperty;

public class Test {

  @ConfigProperty(name="mylog.level")
  private Level level;
}

and see the follwing demo:

LevelDemo

@angelozerr angelozerr force-pushed the logger-level branch 3 times, most recently from 074efa4 to c86d291 Compare November 12, 2020 15:49
@angelozerr angelozerr marked this pull request as ready for review November 12, 2020 15:49
@angelozerr angelozerr requested a review from datho7561 November 12, 2020 15:49
Copy link
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

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

Looks good. There was just a class that I didn't understand that I think could be documented better.

package org.eclipse.lsp4mp.commons.metadata;

/**
* A provider for a value.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand what this class represents. Specifically, I don't know what parameters represents in relation to providing a value for a property. I think it could be better explained in the Javadoc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@datho7561 I have add links to Spring Boot metadata. Please tell me if it's enough.

@angelozerr angelozerr force-pushed the logger-level branch 3 times, most recently from 8e1fa62 to 5871c49 Compare November 16, 2020 15:05
@angelozerr angelozerr force-pushed the logger-level branch 2 times, most recently from f7a8775 to d9813bb Compare November 16, 2020 19:02
@angelozerr angelozerr merged commit b88710c into eclipse-lsp4mp:master Nov 17, 2020
@angelozerr
Copy link
Contributor Author

Thanks @datho7561 for your great review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants