-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add collectionName and databaseName attributes to MongoDbProvider
#3467
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
Closed
Closed
Changes from 2 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
770ca32
Backported changes from the 3.x branch to 2.x
jesmith17 821b77f
Fixed some details in unit tests
jesmith17 8c0e3c6
Improve configuration error handling of HttpAppender (#3438)
Suvrat1629 180b050
Removed wildcard imports from tests
jesmith17 67c70b9
Merge branch '2.x' of github.com:jesmith17/logging-log4j2 into jesmit…
vy 82b30c5
Improve `database.adoc`
vy 1c2bcf8
Fix changelog entry
vy 140aa29
Fix XSD versions
vy 8602d73
Revert changes to resources of old tests
vy eac41a5
Fixed formatting
jesmith17 01d0b81
Fixed constructors to prevent potential backwards compat issues
jesmith17 f328147
Rewmoving maven wrapper that got created locally to solve build issues
jesmith17 d79431b
Publish build scans to develocity.apache.org (#3396)
clayburn fdb3e7d
Fix null termination advice for SOA and JTL
vy 81ba7a4
Bump org.apache.logging:logging-parent from 11.3.0 to 12.0.0 in /log4…
dependabot[bot] 00eb8f4
Run reproducibility check after each deployment
ppkarwasz 4276c2b
Run integration tests after each deployment (#3105)
ppkarwasz 701845f
Fix revision to `2.25.0-SNAPSHOT`
ppkarwasz cb8c7ec
Fix Nexus URL for snapshots
ppkarwasz 0a2566c
Update `org.apache.cassandra:cassandra-all` to version `3.11.19` (#3440)
asf-rm e4982fd
Activate `bom` profile in `log4j-bom`
ppkarwasz 645502a
Add Nexus URL argument to `generate-email.sh` per `logging-parent` up…
vy 8aaf288
Document `maven-compiler-plugin` override
vy 0289d63
Update `org.mongodb:bson` to version `5.3.1` (#3409)
asf-rm 530d850
Implement review feedback
vy 0712cae
Restore `maven-wrapper.properties`
vy 8eef677
Fix plugin names
vy 2a052e1
Fix test resource files
vy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
log4j-mongodb/src/test/java/org/apache/logging/log4j/mongodb/MongoDbCollectionNameIT.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to you under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.logging.log4j.mongodb; | ||
|
|
||
| import com.mongodb.client.MongoClient; | ||
| import org.apache.logging.log4j.core.LoggerContext; | ||
| import org.apache.logging.log4j.core.test.junit.LoggerContextSource; | ||
| import org.apache.logging.log4j.test.junit.UsingStatusListener; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| @UsingMongoDb | ||
| @LoggerContextSource("MongoDbCollectionNameIT.xml") | ||
| // Print debug status logger output upon failure | ||
| @UsingStatusListener | ||
| class MongoDbCollectionNameIT extends AbstractMongoDbCappedIT { | ||
|
|
||
| @Test | ||
| @Override | ||
| protected void test(LoggerContext ctx, MongoClient mongoClient) { | ||
| super.test(ctx, mongoClient); | ||
| } | ||
| } |
36 changes: 36 additions & 0 deletions
36
...db/src/test/java/org/apache/logging/log4j/mongodb/MongoDbDatabaseAndCollectionNameIT.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to you under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.logging.log4j.mongodb; | ||
|
|
||
| import com.mongodb.client.MongoClient; | ||
| import org.apache.logging.log4j.core.LoggerContext; | ||
| import org.apache.logging.log4j.core.test.junit.LoggerContextSource; | ||
| import org.apache.logging.log4j.test.junit.UsingStatusListener; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| @UsingMongoDb | ||
| @LoggerContextSource("MongoDbDatabaseAndCollectionNameIT.xml") | ||
| // Print debug status logger output upon failure | ||
| @UsingStatusListener | ||
| class MongoDbDatabaseAndCollectionNameIT extends AbstractMongoDbCappedIT { | ||
|
|
||
| @Test | ||
| @Override | ||
| protected void test(LoggerContext ctx, MongoClient mongoClient) { | ||
| super.test(ctx, mongoClient); | ||
| } | ||
| } |
36 changes: 36 additions & 0 deletions
36
.../src/test/java/org/apache/logging/log4j/mongodb/MongoDbNoDatabaseAndCollectionNameIT.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to you under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.logging.log4j.mongodb; | ||
|
|
||
| import com.mongodb.client.MongoClient; | ||
| import org.apache.logging.log4j.core.LoggerContext; | ||
| import org.apache.logging.log4j.core.test.junit.LoggerContextSource; | ||
| import org.apache.logging.log4j.test.junit.UsingStatusListener; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| @UsingMongoDb | ||
| @LoggerContextSource("MongoDbNoDatabaseAndCollectionNameIT.xml") | ||
| // Print debug status logger output upon failure | ||
| @UsingStatusListener | ||
| class MongoDbNoDatabaseAndCollectionNameIT extends AbstractMongoDbCappedIT { | ||
|
|
||
| @Test | ||
| @Override | ||
| protected void test(LoggerContext ctx, MongoClient mongoClient) { | ||
| super.test(ctx, mongoClient); | ||
| } | ||
| } |
37 changes: 37 additions & 0 deletions
37
log4j-mongodb/src/test/resources/MongoDbCollectionNameIT.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| ~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
| ~ contributor license agreements. See the NOTICE file distributed with | ||
| ~ this work for additional information regarding copyright ownership. | ||
| ~ The ASF licenses this file to you under the Apache License, Version 2.0 | ||
| ~ (the "License"); you may not use this file except in compliance with | ||
| ~ the License. You may obtain a copy of the License at | ||
| ~ | ||
| ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| ~ | ||
| ~ Unless required by applicable law or agreed to in writing, software | ||
| ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| ~ See the License for the specific language governing permissions and | ||
| ~ limitations under the License. | ||
| --> | ||
| <Configuration xmlns="https://logging.apache.org/xml/ns" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation=" | ||
| https://logging.apache.org/xml/ns | ||
| https://logging.apache.org/xml/ns/log4j-config-3.xsd"> | ||
| <Appenders> | ||
| <NoSql name="MONGO"> | ||
| <MongoDb | ||
| connection="mongodb://localhost:${sys:log4j.mongo.port:-27017}/testDb" | ||
| capped="true" | ||
| collectionSize="1073741824" | ||
| collectionName="MongoDbCollectionNameIT"/> | ||
| </NoSql> | ||
| </Appenders> | ||
| <Loggers> | ||
| <Root level="ALL"> | ||
| <AppenderRef ref="MONGO" /> | ||
| </Root> | ||
| </Loggers> | ||
| </Configuration> |
39 changes: 39 additions & 0 deletions
39
log4j-mongodb/src/test/resources/MongoDbDatabaseAndCollectionNameIT.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| ~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
| ~ contributor license agreements. See the NOTICE file distributed with | ||
| ~ this work for additional information regarding copyright ownership. | ||
| ~ The ASF licenses this file to you under the Apache License, Version 2.0 | ||
| ~ (the "License"); you may not use this file except in compliance with | ||
| ~ the License. You may obtain a copy of the License at | ||
| ~ | ||
| ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| ~ | ||
| ~ Unless required by applicable law or agreed to in writing, software | ||
| ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| ~ See the License for the specific language governing permissions and | ||
| ~ limitations under the License. | ||
| --> | ||
| <Configuration xmlns="https://logging.apache.org/xml/ns" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation=" | ||
| https://logging.apache.org/xml/ns | ||
| https://logging.apache.org/xml/ns/log4j-config-3.xsd"> | ||
| <Appenders> | ||
| <NoSql name="MONGO"> | ||
| <MongoDb | ||
| connection="mongodb://localhost:${sys:log4j.mongo.port:-27017}" | ||
| capped="true" | ||
| collectionSize="1073741824" | ||
| databaseName="testDb" | ||
| collectionName="MongoDbDatabaseAndCollectionNameIT" | ||
| /> | ||
| </NoSql> | ||
| </Appenders> | ||
| <Loggers> | ||
| <Root level="ALL"> | ||
| <AppenderRef ref="MONGO" /> | ||
| </Root> | ||
| </Loggers> | ||
| </Configuration> |
37 changes: 37 additions & 0 deletions
37
log4j-mongodb/src/test/resources/MongoDbNoDatabaseAndCollectionNameIT.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| ~ Licensed to the Apache Software Foundation (ASF) under one or more | ||
| ~ contributor license agreements. See the NOTICE file distributed with | ||
| ~ this work for additional information regarding copyright ownership. | ||
| ~ The ASF licenses this file to you under the Apache License, Version 2.0 | ||
| ~ (the "License"); you may not use this file except in compliance with | ||
| ~ the License. You may obtain a copy of the License at | ||
| ~ | ||
| ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| ~ | ||
| ~ Unless required by applicable law or agreed to in writing, software | ||
| ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| ~ See the License for the specific language governing permissions and | ||
| ~ limitations under the License. | ||
| --> | ||
| <Configuration xmlns="https://logging.apache.org/xml/ns" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation=" | ||
| https://logging.apache.org/xml/ns | ||
| https://logging.apache.org/xml/ns/log4j-config-3.xsd"> | ||
| <Appenders> | ||
| <NoSql name="MONGO"> | ||
| <MongoDb | ||
| connection="mongodb://localhost:${sys:log4j.mongo.port:-27017}/testDb.MongoDbNoDatabaseAndCollectionNameIT" | ||
| capped="true" | ||
| collectionSize="1073741824" | ||
| /> | ||
| </NoSql> | ||
| </Appenders> | ||
| <Loggers> | ||
| <Root level="ALL"> | ||
| <AppenderRef ref="MONGO" /> | ||
| </Root> | ||
| </Loggers> | ||
| </Configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.