[
https://issues.apache.org/jira/browse/METRON-1295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16238294#comment-16238294
]
ASF GitHub Bot commented on METRON-1295:
----------------------------------------
GitHub user nickwallen opened a pull request:
https://github.com/apache/metron/pull/828
METRON-1295 Unable to Configure Logging for REST API
When configuring the logging for the REST API, the following exception
occurs.
```
log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is not
assignable to a "org.apache.hadoop.hbase.shaded.org.apache.log4j.Appender"
variable.
```
This change prevents the shaded log4j dependencies of metron-hbase from
bleeding into metron-rest.
## Testing
1. Spin-up Full Dev
2. Create a log4j configuration file. In this example
`/usr/metron/0.4.2/config/log4j.properties`
3. Add the following to "Metron JVM Flags" in Ambari > Metron > Config.
```
-Dlog4j.debug
-Dlog4j.configuration=file:/usr/metron/0.4.2/config/log4j.properties
```
4. Restart Metron REST and watch the logging output. Ensure that you can
configure logging as you would expect.
## Pull Request Checklist
- [ ] Is there a JIRA ticket associated with this PR? If not one needs to
be created at [Metron
Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel).
- [ ] Does your PR title start with METRON-XXXX where XXXX is the JIRA
number you are trying to resolve? Pay particular attention to the hyphen "-"
character.
- [ ] Has your PR been rebased against the latest commit within the target
branch (typically master)?
- [ ] Have you included steps to reproduce the behavior or problem that is
being changed or addressed?
- [ ] Have you included steps or a guide to how the change may be verified
and tested manually?
- [ ] Have you ensured that the full suite of tests and checks have been
executed in the root metron folder via:
- [ ] Have you written or updated unit tests and or integration tests to
verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] Have you verified the basic functionality of the build by building
and running locally with Vagrant full-dev environment or the equivalent?
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/nickwallen/metron METRON-1295
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/metron/pull/828.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #828
----
commit a7a7174d28f08cf95093a9ffff5bee257185c161
Author: Nick Allen <[email protected]>
Date: 2017-11-02T14:04:04Z
METRON-1295 Unable to Configure Logging for REST API
----
> Unable to Configure Logging for REST API
> ----------------------------------------
>
> Key: METRON-1295
> URL: https://issues.apache.org/jira/browse/METRON-1295
> Project: Metron
> Issue Type: Bug
> Reporter: Nick Allen
> Assignee: Nick Allen
> Priority: Normal
>
> I have not been able to configure logging for the REST API. To replicate,
> create a log4j configuration file, then add the following to "Metron JVM
> Flags" in Ambari > Metron > Config.
> {code}
> -Dlog4j.debug
> -Dlog4j.configuration=file:/usr/metron/0.4.2/config/log4j.properties
> {code}
> This will result in the following exception when Log4j initializes.
> {code}
> log4j: Using URL [file:/usr/metron/0.4.2/config/log4j.properties] for
> automatic log4j configuration.
> log4j: Reading configuration from URL
> file:/usr/metron/0.4.2/config/log4j.properties
> log4j: Parsing for [root] with value=[INFO, file].
> log4j: Level token is [INFO].
> log4j: Category root set to INFO
> log4j: Parsing appender named "file".
> log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is not assignable
> to a "org.apache.hadoop.hbase.shaded.org.apache.log4j.Appender" variable.
> log4j:ERROR The class
> "org.apache.hadoop.hbase.shaded.org.apache.log4j.Appender" was loaded by
> log4j:ERROR [sun.misc.Launcher$AppClassLoader@5c647e05] whereas object of type
> log4j:ERROR "org.apache.log4j.RollingFileAppender" was loaded by
> [sun.misc.Launcher$AppClassLoader@5c647e05].
> log4j:ERROR Could not instantiate appender named "file".
> log4j: Finished configuring.
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)