Update MongoDbPatternLayoutAppender.java to save timestamp as a date type in mongodb#6
Update MongoDbPatternLayoutAppender.java to save timestamp as a date type in mongodb#6pramodransingh wants to merge 1 commit intoRobertStewart:masterfrom pramodransingh:master
Conversation
adding code to save pattern layout timestamp in the mongodb as a Date type. Before it was getting saved as a string.
|
Thanks for the contribution, but I'd like to request a few changes before I merge it.
Thanks! |
|
Thanks for sharing your feedback.
So here I am creating new independent class
MongoDbPatternLayoutDateAppender which extends the MongoDbAppender .
And overriding required methods.
Please have a look and let me know if any other changes needed.
Thanks,
Pramod
…On 12-Aug-2018 9:57 am, "Robert Stewart" ***@***.***> wrote:
Thanks for the contribution, but I'd like to request a few changes before
I merge it.
1.
I don't want to change the existing behavior of
MongoDbPatternLayoutAppender, because this change will break compatibility
for people already using it. Please create a new class named
MongoDbPatternLayoutDateAppender that extends
MongoDbPatternLayoutAppender and overrides append(). Since that means you
would inherit only requiresLayout(), I'm fine if you either create an
independent class or if you extract a protected method around where the
bson variable is set and you override that.
2.
You are missing imports for org.apache.log4j.Layout and
java.util.Date, which prevents the code from compiling.
3.
Please use the syntax conventions used in the rest of the code, e.g.,
a blank space before a ( and =.
Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHl-cEBgCm5CT49oqQGo2M8rZ9u220Mgks5uP660gaJpZM4VzwVp>
.
|
|
Were you planning to update the pull request? I don't see any changes, yet. |
|
I am closing this PR and creating new one |
|
Following are the two PR:
#12
log4mongo#40
…On Mon, Aug 13, 2018 at 11:34 PM, Robert Stewart ***@***.***> wrote:
Were you planning to update the pull request? I don't see any changes, yet.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHl-cAO7bWtBudXlgfgSCJVjf0hE4XCVks5uQkVKgaJpZM4VzwVp>
.
|
adding code to save pattern layout timestamp in the mongodb as a Date type. Before it was getting saved as a string.