Open garyrussell opened 6 years ago
I think you can just write:
logging.level.org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer=info
Or doesn't that work?
BTW: I think if you are going to use the '[]' notation, which is kind of logical here, I aggree, I think you probably shouldn't add the extra '.'. So like this:
logging.level[org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer]=info
But I checked and STS also doesn't 'approve' of that notation.
I think it is because we are assuming the notation with '[]' is meant for indexing with numbers inside of 'array-like' constructs. If that was ever really the way it worked (?), at least it looks like this is no longer really the case, so this is definitely a bug we should fix.
Unfortunately, no; Boot strips out the $
- see the referenced Boot issue.
Looks like [...]
indicates an index or a map key
* <p>
* The "{@code [}" and "{@code ]}" characters may be used to indicate an associative
* index(i.e. a {@link Map} key or a {@link Collection} index. Indexes names are not
* restricted and are considered case-sensitive.
I just tested it and boot doesn't care whether or not there is a dot before the [
..
logging:
level:
org.springframework.kafka.listener[KafkaMessageListenerContainer$ListenerConsumer]: info
works too.
and this
logging.level[org.springframework.kafka.listener.KafkaMessageListenerContainer$ListenerConsumer]: info
The STS 'parser' for these '.' and '[]' things probably does care... If I remember correctly. So that's another bug.
I've asked on the boot doco issue: https://github.com/spring-projects/spring-boot/issues/13506#issuecomment-399538062
The boot team confirmed that both syntaxes are supported (with/without .
before [
).
See https://github.com/spring-projects/spring-boot/issues/13555
This syntax is allowed:
and is required when the logger is for an innner class (contains
$
).However, STS flags this as invalid syntax
Also, similar keys in YAML are indicated in black: