Re: Enabling Flume log4j appender logging in Karaf

2014-10-21 Thread syedbahm
The fragment seems to show as resolved -- so if it is working we should 
have seen it connecting to the hostname specified in the appender 
configuration -- which is not happening. How can I find out if its 
reaching the point of instantiating the appender specified class and 
actually trying to append any log.


Details:

bundle:list or la
shows that the fragment host is resolved.
---
 7 | Resolved |   7 | 1.0.0.SNAPSHOT | Flume NG Log4j Appender, 
Hosts: 9

 8 | Active   |   8 | 1.7.2  | OPS4J Pax Logging - API
 9 | Active   |   8 | 1.7.2  | OPS4J Pax Logging - 
Service, Fragments: 76, 7

---

opendaylight-user@rootbundle:info 9

OPS4J Pax Logging - Service (9)
---
opendaylight-user@rootbundle:refresh 9
Error executing command: Access to system bundle 9 denied. You can 
override with -f

opendaylight-user@rootbundle:refresh -f 9
opendaylight-user@rootbundle:info 9

OPS4J Pax Logging - Service (9)
---
opendaylight-user@rootbundle:refresh -f 7
opendaylight-user@rootbundle:info 7

Flume NG Log4j Appender (7)
---
opendaylight-user@rootbundle:info 7

Flume NG Log4j Appender (7)
---
opendaylight-user@root



On 10/20/2014 10:38 PM, Achim Nierbeck wrote:


Hi
Is the fragment bundle attached to the host bundle. You can tell by 
listing all bundles with la. The fragment bundle should be in resolved 
state.
If you do a bundle: info on the host or fragment it should also tell 
you if the fragment is attached.

If not try a refresh on the host bundle.

Regards, Achim

sent from mobile device

Am 20.10.2014 23:20 schrieb syedbahm syedb...@cisco.com 
mailto:syedb...@cisco.com:


Forgot to mention
   Please let me know what knobs can I turn on to further debug
this thing.
I tried remote debugging karaf with flume4jappender it looks like the
appender class is not called out at all. How can I further debug whats
happenning?



--
View this message in context:

http://karaf.922171.n3.nabble.com/Enabling-Flume-log4j-appender-logging-in-Karaf-tp4036033p4036035.html
Sent from the Karaf - User mailing list archive at Nabble.com.





Re: Enabling Flume log4j appender logging in Karaf

2014-10-21 Thread Achim Nierbeck
The good news,
Your setup is good as the list of bundles already shows the fragment bundle
to be attached to the right host bundle.
Does the appender require something special? Any certain classes from
log4j?
You could try to debug into the appender and try to see if it is actually
called. If not it's something in the configuration.

Regards, Achim

sent from mobile device
Am 21.10.2014 08:29 schrieb syedbahm syedb...@cisco.com:

  The fragment seems to show as resolved -- so if it is working we should
 have seen it connecting to the hostname specified in the appender
 configuration -- which is not happening. How can I find out if its reaching
 the point of instantiating the appender specified class and actually trying
 to append any log.

 Details:

 bundle:list or la
 shows that the fragment host is resolved.
 ---
  7 | Resolved |   7 | 1.0.0.SNAPSHOT | Flume NG Log4j Appender,
 Hosts: 9
  8 | Active   |   8 | 1.7.2  | OPS4J Pax Logging -
 API
  9 | Active   |   8 | 1.7.2  | OPS4J Pax Logging -
 Service, Fragments: 76, 7
 ---

 opendaylight-user@rootbundle:info 9

 OPS4J Pax Logging - Service (9)
 ---
 opendaylight-user@rootbundle:refresh 9
 Error executing command: Access to system bundle 9 denied. You can
 override with -f
 opendaylight-user@rootbundle:refresh -f 9
 opendaylight-user@rootbundle:info 9

 OPS4J Pax Logging - Service (9)
 ---
 opendaylight-user@rootbundle:refresh -f 7
 opendaylight-user@rootbundle:info 7

 Flume NG Log4j Appender (7)
 ---
 opendaylight-user@rootbundle:info 7

 Flume NG Log4j Appender (7)
 ---
 opendaylight-user@root



 On 10/20/2014 10:38 PM, Achim Nierbeck wrote:

 Hi
 Is the fragment bundle attached to the host bundle. You can tell by
 listing all bundles with la. The fragment bundle should be in resolved
 state.
 If you do a bundle: info on the host or fragment it should also tell you
 if the fragment is attached.
 If not try a refresh on the host bundle.

 Regards, Achim

 sent from mobile device
 Am 20.10.2014 23:20 schrieb syedbahm syedb...@cisco.com:

 Forgot to  mention
Please let me know what knobs can I turn on to further debug this
 thing.
 I tried remote debugging karaf with flume4jappender it looks like the
 appender class is not called out at all. How can I further debug whats
 happenning?



 --
 View this message in context:
 http://karaf.922171.n3.nabble.com/Enabling-Flume-log4j-appender-logging-in-Karaf-tp4036033p4036035.html
 Sent from the Karaf - User mailing list archive at Nabble.com.





Re: Enabling Flume log4j appender logging in Karaf

2014-10-21 Thread syedbahm
I tried remote debugging by putting karaf in debug + suspend mode and 
connect from the other end running log4j flume appender code. The log4j 
flume Appender class configured in org.ops4j.pax.logging.cfg as shown 
below doesn't get called.


---
# Root logger
log4j.rootLogger = DEBUG, out, flume, osgi:*

# flume appender
log4j.appender.flume=org.apache.flume.clients.log4jappender.Log4jAppender
log4j.appender.flume.Port=7070
log4j.appender.flume.Hostname=my lab setup ip
log4j.appender.flume.layout=org.apache.log4j.PatternLayout

-

When you mentioned it might be related to configuration -- can you 
further provide details about which config you are doubting ?


thx
-syed






On 10/20/2014 11:49 PM, Achim Nierbeck wrote:


The good news,
Your setup is good as the list of bundles already shows the fragment 
bundle to be attached to the right host bundle.
Does the appender require something special? Any certain classes from 
log4j?
You could try to debug into the appender and try to see if it is 
actually called. If not it's something in the configuration.


Regards, Achim

sent from mobile device

Am 21.10.2014 08:29 schrieb syedbahm syedb...@cisco.com 
mailto:syedb...@cisco.com:


The fragment seems to show as resolved -- so if it is working we
should have seen it connecting to the hostname specified in the
appender configuration -- which is not happening. How can I find
out if its reaching the point of instantiating the appender
specified class and actually trying to append any log.

Details:

bundle:list or la
shows that the fragment host is resolved.
---
 7 | Resolved |   7 | 1.0.0.SNAPSHOT | Flume NG Log4j
Appender, Hosts: 9
 8 | Active   |   8 | 1.7.2  | OPS4J Pax Logging -
API
 9 | Active   |   8 | 1.7.2  | OPS4J Pax Logging -
Service, Fragments: 76, 7
---

opendaylight-user@rootbundle:info 9

OPS4J Pax Logging - Service (9)
---
opendaylight-user@rootbundle:refresh 9
Error executing command: Access to system bundle 9 denied. You can
override with -f
opendaylight-user@rootbundle:refresh -f 9
opendaylight-user@rootbundle:info 9

OPS4J Pax Logging - Service (9)
---
opendaylight-user@rootbundle:refresh -f 7
opendaylight-user@rootbundle:info 7

Flume NG Log4j Appender (7)
---
opendaylight-user@rootbundle:info 7

Flume NG Log4j Appender (7)
---
opendaylight-user@root



On 10/20/2014 10:38 PM, Achim Nierbeck wrote:


Hi
Is the fragment bundle attached to the host bundle. You can tell
by listing all bundles with la. The fragment bundle should be in
resolved state.
If you do a bundle: info on the host or fragment it should also
tell you if the fragment is attached.
If not try a refresh on the host bundle.

Regards, Achim

sent from mobile device

Am 20.10.2014 23:20 schrieb syedbahm syedb...@cisco.com
mailto:syedb...@cisco.com:

Forgot to  mention
   Please let me know what knobs can I turn on to further
debug this thing.
I tried remote debugging karaf with flume4jappender it looks
like the
appender class is not called out at all. How can I further
debug whats
happenning?



--
View this message in context:

http://karaf.922171.n3.nabble.com/Enabling-Flume-log4j-appender-logging-in-Karaf-tp4036033p4036035.html
Sent from the Karaf - User mailing list archive at Nabble.com.







Enabling Flume log4j appender logging in Karaf

2014-10-20 Thread syedbahm

Hi,
I have been trying unsuccessfully to have a karaf distribution connect 
to elastic search via flume using the FlumeLog4jAppender.


 I followed the steps listed here 
http://blog.nanthrax.net/2012/12/create-custom-log4j-appender-for-karaf-and-pax-logging/ 
for adding a custom appender and applied them to flume's source log4j 
appender module and the karaf logging service configuration files.  From 
karaf console I see that the flume-log4jappender module appears as 
resolved and see that the logging-service is in active state.


In the logs I see the following that doesn't give much information.. 
being new to Karaf not sure what to  make out of those messages.


---
 | 20 - org.apache.aries.blueprint.core - 1.4.0 | No blueprint 
application found in bundle org.ops4j.pax.logging.pax-logging-service
2014-10-20 11:37:11,305 | DEBUG | Event Dispatcher | 
BlueprintExtender| 20 - org.apache.aries.blueprint.core 
- 1.4.0 | Starting BlueprintContainer destruction process for bundle 
org.apache.flume.log4jappender
2014-10-20 11:37:11,305 | DEBUG | Event Dispatcher | 
BlueprintExtender| 20 - org.apache.aries.blueprint.core 
- 1.4.0 | Not a blueprint bundle or destruction of BlueprintContainer 
already finished for org.apache.flume.log4jappender.




Please see my detailed configuration below.
thx
-Syed



Here is how my modified flume log4j appender module pom.xml looks

-
1.

project xmlns=http://maven.apache.org/POM/4.0.0; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;

modelVersion4.0.0/modelVersion
parent
groupIdcom.company.one/groupId
artifactIdcommons.parent/artifactId
version1.0.0-SNAPSHOT/version
relativePath../../commons/parent/relativePath
/parent

  groupIdorg.apache.flume.flume-ng-clients/groupId
  artifactIdflume-ng-log4jappender/artifactId
  nameFlume NG Log4j Appender/name

build
plugins

plugin
groupIdorg.apache.felix/groupId
artifactIdmaven-bundle-plugin/artifactId
version2.3.5/version
executions
execution
phasepackage/phase
goals
goalbundle/goal
/goals
/execution
/executions
extensionstrue/extensions
configuration
instructions
Export-Package
org.apache.flume.clients.log4jappender
/Export-Package
Import-Package/Import-Package
Fragment-Hostorg.ops4j.pax.logging.pax-logging-service/Fragment-Host
Bundle-SymbolicNameorg.apache.flume.log4jappender/Bundle-SymbolicName
_failoktrue/_failok
/instructions
/configuration
/plugin
/plugins
  /build
  dependencies
dependency
groupIdjunit/groupId
artifactIdjunit/artifactId
version4.10/version
scopetest/scope
/dependency


dependency
groupIdlog4j/groupId
artifactIdlog4j/artifactId
version1.2.17/version
/dependency

dependency
groupIdlog4j/groupId
artifactIdapache-log4j-extras/artifactId
version1.1/version
/dependency
dependency
groupIdorg.apache.flume/groupId
artifactIdflume-ng-sdk/artifactId
version1.6.0-SNAPSHOT/version
/dependency

!-- pull in flume core only for unit tests. TODO: not ideal --
dependency
groupIdorg.apache.flume/groupId
artifactIdflume-ng-core/artifactId
version1.6.0-SNAPSHOT/version
scopetest/scope
/dependency

dependency
groupIdorg.apache.flume/groupId
artifactIdflume-ng-configuration/artifactId
version1.6.0-SNAPSHOT/version
scopetest/scope
/dependency

dependency
groupIdorg.ops4j.pax.logging/groupId
artifactIdpax-logging-service/artifactId
version1.7.2/version
/dependency


/dependencies

/project
--

2. I have placed the flume-ng-log4jappender-1.0.0-SNAPSHOT.jar in karaf 
sytem's folder and the path looks like this


system/org/apache/flume/flume-ng-clients/flume-ng-log4jappender/1.0.0-SNAPSHOT/

3. I have modified the /etc/startup.properties as

mvn\:org.ops4j.pax.url/pax-url-wrap/1.6.0 = 5
*mvn\:org.ops4j.pax.logging/pax-logging-api/1.7.2 = 8**
**mvn\:org.ops4j.pax.logging/pax-logging-service/1.7.2 = 8**
**mvn\:org.apache.flume.flume-ng-clients/flume-ng-log4jappender/1.0.0-SNAPSHOT 
= 8*


mvn\:org.apache.karaf.service/org.apache.karaf.service.guard/3.0.1 = 10
mvn\:org.apache.felix/org.apache.felix.configadmin/1.6.0 = 10
mvn\:org.apache.felix/org.apache.felix.fileinstall/3.2.8 = 11

4. I have modified the  etc/org.ops4j.pax.logging.cfg to include the 
flume appender as follows


# Root logger
log4j.rootLogger = DEBUG, out, 

Re: Enabling Flume log4j appender logging in Karaf

2014-10-20 Thread syedbahm
Forgot to  mention 
   Please let me know what knobs can I turn on to further debug this thing. 
I tried remote debugging karaf with flume4jappender it looks like the
appender class is not called out at all. How can I further debug whats
happenning?



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Enabling-Flume-log4j-appender-logging-in-Karaf-tp4036033p4036035.html
Sent from the Karaf - User mailing list archive at Nabble.com.