Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

Add static fields #57

Merged
merged 6 commits into from
Sep 19, 2015
Merged

Add static fields #57

merged 6 commits into from
Sep 19, 2015

Conversation

Moocar
Copy link
Owner

@Moocar Moocar commented Jul 8, 2015

Addresses #55 by making static fields structured instead of relying on colon parsing. Thankfully the name staticField wasn't taken so staticAdditionalField is now deprecated. Read README changes for more info.

Note, it would be really nice if the user didn't have to enter the class me.moocar.logbackgelf.Field manually each time, but after having perused through the logback documentation, I'm not aware of how to do this.

@roomsg
Copy link

roomsg commented Jul 14, 2015

as you have stated in the original request (#55), simple colon parsing might not be the best solution. So, I tend to like the new key/value proposal, yet in practice,indeed, the need to mention the class me.moocar.logbackgelf.Field for each static field makes it rather annoying...

@roomsg
Copy link

roomsg commented Jul 14, 2015

An alternative syntax would be more user friendly when multiple static fields are to be defined, something like:

<staticField class="me.moocar.logbackgelf.Field">
    <property_key1>property_value1</property_key1>
    <property_key2>property_value2</property_key2>
</staticField>

It looks like valid logback syntax to me, not sure of it though, and not sure if feasible to implement. Would this be an option ?

@roomsg
Copy link

roomsg commented Jul 14, 2015

Nope, I guess you can forget about my previous comment, presumably it's not valid syntax (those child nodes need to correspond to members of class of the enclosing node, I guess).

@roomsg
Copy link

roomsg commented Jul 14, 2015

@Moocar
Copy link
Owner Author

Moocar commented Sep 19, 2015

Hey @roomsg, sorry for the late response here. The Collection of Properties refers to the ability to add many of a type of property instead of a single one. E.g, say foo is of type String, then you set a single instance of it with setFoo(...), but if you define it as a collection of Strings, you then add instances of it with addFoo(...).

It's been 2 months and I haven't thought of any better solutions here, so I'm just going to merge. I really wish logback was in Clojure. These kind of problems would just disappear :P

Moocar added a commit that referenced this pull request Sep 19, 2015
@Moocar Moocar merged commit 077b164 into master Sep 19, 2015
@Moocar Moocar deleted the add-static-fields branch September 19, 2015 16:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants