You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Olivier Schmitt <sc...@metaintegration.net> on 2007/10/09 03:07:11 UTC

Logging LDAP requests

Hello all,

I am a new user of Apache Directory Server 1.5, and so far I love it!
It is pretty easy to use and configure, and the Studio UI is nice too.

Now, I am trying figure out why my business app cannot connect to it.
In order to better understand what is going wrong, I would like to enable
logging of LDAP requests coming into the server.
As recommended on the page
http://directory.apache.org/apacheds/1.5/145-configure-logging.html
I tinkered with the logging parameters, but could not find appropriate level
of detail I am interested in, it would report either nothing, or a huge lot
of things I cant make sense of.

Is there a simple way to set the logging to display something like this?
- LDAP server received BIND request (+details of bind request)
- LDAP server received SEARCH request (+details or search request)
...

Thanks.

Olivier



Re: Logging LDAP requests

Posted by Alex Karasulu <ak...@apache.org>.
Oh great!  Glad to hear it.

Alex

On 10/9/07, Olivier Schmitt <sc...@metaintegration.net> wrote:
>
> Hi Alex,
>
> I just changed the level of trace from INFO to DEBUG like this:
> log4j.logger.org.apache.directory.server.ldap=DEBUG
> #General Frontend Handling
> log4j.logger.org.apache.directory.server.ldap.support.bind=DEBUG
> #For SASL binds
> log4j.logger.org.apache.directory.server.ldap.support.BindHandler=DEBUG
> #For Simple binds
> log4j.logger.org.apache.directory.server.ldap.support.SearchHandler=DEBUG
>
> And I can now see the incoming messages in the log file.
> Thanks!
>
> Olivier
>
> -----Original Message-----
> From: akarasulu@gmail.com [mailto:akarasulu@gmail.com] On Behalf Of Alex
> Karasulu
> Sent: Tuesday, October 09, 2007 12:15 PM
> To: users@directory.apache.org
> Subject: Re: Logging LDAP requests
>
> Hi Olivier,
>
> On 10/9/07, Olivier Schmitt <sc...@metaintegration.net> wrote:
> >
> > Thanks for the tips, I have put this in my config file, but it doesn't
> > seem
> > to be working correctly.
> > Yes, I am using WinXP, do you think there are issue with log4j
> > specifically
> > on windows?
>
>
> Yeah I'm afraid there might be.  Perhaps the log4j.propertiesconfiguration
> is not
> being picked up by how the installer is setting things up to point the
> server to it's
> home directory.  Hence the reason why your configuration changes are not
> being
> felt.
>
> Chris you have any ideas on what could be going on in Windows with
> correctly
> picking up the right log4j configuration from the install home?  Perhaps
> Olivier is
> not configuring the right log4j.properties in the proper server instance?
>
> Thanks,
> Alex
>
>

RE: Logging LDAP requests

Posted by Olivier Schmitt <sc...@metaintegration.net>.
Hi Alex,

I just changed the level of trace from INFO to DEBUG like this:
log4j.logger.org.apache.directory.server.ldap=DEBUG
#General Frontend Handling
log4j.logger.org.apache.directory.server.ldap.support.bind=DEBUG
#For SASL binds
log4j.logger.org.apache.directory.server.ldap.support.BindHandler=DEBUG
#For Simple binds
log4j.logger.org.apache.directory.server.ldap.support.SearchHandler=DEBUG

And I can now see the incoming messages in the log file.
Thanks!

Olivier

-----Original Message-----
From: akarasulu@gmail.com [mailto:akarasulu@gmail.com] On Behalf Of Alex
Karasulu
Sent: Tuesday, October 09, 2007 12:15 PM
To: users@directory.apache.org
Subject: Re: Logging LDAP requests

Hi Olivier,

On 10/9/07, Olivier Schmitt <sc...@metaintegration.net> wrote:
>
> Thanks for the tips, I have put this in my config file, but it doesn't
> seem
> to be working correctly.
> Yes, I am using WinXP, do you think there are issue with log4j
> specifically
> on windows?


Yeah I'm afraid there might be.  Perhaps the log4j.properties configuration
is not
being picked up by how the installer is setting things up to point the
server to it's
home directory.  Hence the reason why your configuration changes are not
being
felt.

Chris you have any ideas on what could be going on in Windows with correctly
picking up the right log4j configuration from the install home?  Perhaps
Olivier is
not configuring the right log4j.properties in the proper server instance?

Thanks,
Alex


Re: Logging LDAP requests

Posted by Alex Karasulu <ak...@apache.org>.
Hi Olivier,

On 10/9/07, Olivier Schmitt <sc...@metaintegration.net> wrote:
>
> Thanks for the tips, I have put this in my config file, but it doesn't
> seem
> to be working correctly.
> Yes, I am using WinXP, do you think there are issue with log4j
> specifically
> on windows?


Yeah I'm afraid there might be.  Perhaps the log4j.properties configuration
is not
being picked up by how the installer is setting things up to point the
server to it's
home directory.  Hence the reason why your configuration changes are not
being
felt.

Chris you have any ideas on what could be going on in Windows with correctly
picking up the right log4j configuration from the install home?  Perhaps
Olivier is
not configuring the right log4j.properties in the proper server instance?

Thanks,
Alex

RE: Logging LDAP requests

Posted by Olivier Schmitt <sc...@metaintegration.net>.
Thanks for the tips, I have put this in my config file, but it doesn't seem
to be working correctly.
Yes, I am using WinXP, do you think there are issue with log4j specifically
on windows?

Yes, I can connect to ADS from the Studio UI and other UIs as well with no
problem. But I would like the ability to "spy" on the requests coming into
the server. To compare for example the requests issued by Studio and the
requests issued by my business app which fails to retrieve the users for
some reason.

Thanks.

Olivier

-----Original Message-----
From: akarasulu@gmail.com [mailto:akarasulu@gmail.com] On Behalf Of Alex
Karasulu
Sent: Monday, October 08, 2007 7:38 PM
To: users@directory.apache.org
Subject: Re: Logging LDAP requests

On 10/8/07, Olivier Schmitt <sc...@metaintegration.net> wrote:
>
> I am a new user of Apache Directory Server 1.5, and so far I love it!
> It is pretty easy to use and configure, and the Studio UI is nice too.


Cool beans!

Now, I am trying figure out why my business app cannot connect to it.
> In order to better understand what is going wrong, I would like to enable
> logging of LDAP requests coming into the server.


It should not matter but sometimes Windows does odd things with logging
so could you let us know if you're running on windows or not?

As recommended on the page
> http://directory.apache.org/apacheds/1.5/145-configure-logging.html
> I tinkered with the logging parameters, but could not find appropriate
> level
> of detail I am interested in, it would report either nothing, or a huge
> lot
> of things I cant make sense of.


Right you probably set the global log level and that just turned on
everything.

Is there a simple way to set the logging to display something like this?
> - LDAP server received BIND request (+details of bind request)
> - LDAP server received SEARCH request (+details or search request)
>

I would leave the global log level on WARN and add the following lines to
your
log4j.properties then tweak (comment out) them depending on what you're
interested
in:

log4j.logger.org.apache.directory.server.ldap=INFO
#General Frontend Handling
log4j.logger.org.apache.directory.server.ldap.support.bind=INFO
#For SASL binds
log4j.logger.org.apache.directory.server.ldap.support.BindHandler=INFO
#For Simple binds
log4j.logger.org.apache.directory.server.ldap.support.SearchHandler=INFO

There's more to it if you want to get into the internals.  I would first
write a simple
application and make sure you can connect to the server or just use Studio
to do
it to confirm it is configured properly and go from there.

HTH,
Alex


Re: Logging LDAP requests

Posted by Przemyslaw Rudzki <er...@erace.pl>.
BTW. How can I get rid of those warnings when running ApacheDS inside
JBoss?

...
09:41:27,128 INFO  [STDOUT] [09:41:27] WARN
[org.apache.directory.server.core.partition.impl.btree.BTreePartition] -
Using default cache size of 100 for index on attribute
1.3.6.1.4.1.18060.0.4.1.2.3
09:41:27,133 INFO  [STDOUT] [09:41:27] WARN
[org.apache.directory.server.core.partition.impl.btree.BTreePartition] -
Using default cache size of 100 for index on attribute objectClass
09:41:27,136 INFO  [STDOUT] [09:41:27] WARN
[org.apache.directory.server.core.partition.impl.btree.BTreePartition] -
Using default cache size of 100 for index on attribute
1.3.6.1.4.1.18060.0.4.1.2.1
09:41:27,138 INFO  [STDOUT] [09:41:27] WARN
[org.apache.directory.server.core.partition.impl.btree.BTreePartition] -
Using default cache size of 100 for index on attribute
1.3.6.1.4.1.18060.0.4.1.2.6
09:41:27,140 INFO  [STDOUT] [09:41:27] WARN
[org.apache.directory.server.core.partition.impl.btree.BTreePartition] -
Using default cache size of 100 for index on attribute
1.3.6.1.4.1.18060.0.4.1.2.7
09:41:27,142 INFO  [STDOUT] [09:41:27] WARN
[org.apache.directory.server.core.partition.impl.btree.BTreePartition] -
Using default cache size of 100 for index on attribute
1.3.6.1.4.1.18060.0.4.1.2.4
...

I have tried the following stuff:

log4j.logger.org.apache.directory.server.core.*=ERROR
log4j.logger.org.apache.directory.server.core.partition.impl.btree.BTreePartition=INFO

But it does not work as expected.

/p

On Mon, 2007-10-08 at 22:38 -0400, Alex Karasulu wrote:
> On 10/8/07, Olivier Schmitt <sc...@metaintegration.net> wrote:
> >
> > I am a new user of Apache Directory Server 1.5, and so far I love it!
> > It is pretty easy to use and configure, and the Studio UI is nice too.
> 
> 
> Cool beans!
> 
> Now, I am trying figure out why my business app cannot connect to it.
> > In order to better understand what is going wrong, I would like to enable
> > logging of LDAP requests coming into the server.
> 
> 
> It should not matter but sometimes Windows does odd things with logging
> so could you let us know if you're running on windows or not?
> 
> As recommended on the page
> > http://directory.apache.org/apacheds/1.5/145-configure-logging.html
> > I tinkered with the logging parameters, but could not find appropriate
> > level
> > of detail I am interested in, it would report either nothing, or a huge
> > lot
> > of things I cant make sense of.
> 
> 
> Right you probably set the global log level and that just turned on
> everything.
> 
> Is there a simple way to set the logging to display something like this?
> > - LDAP server received BIND request (+details of bind request)
> > - LDAP server received SEARCH request (+details or search request)
> >
> 
> I would leave the global log level on WARN and add the following lines to
> your
> log4j.properties then tweak (comment out) them depending on what you're
> interested
> in:
> 
> log4j.logger.org.apache.directory.server.ldap=INFO
> #General Frontend Handling
> log4j.logger.org.apache.directory.server.ldap.support.bind=INFO
> #For SASL binds
> log4j.logger.org.apache.directory.server.ldap.support.BindHandler=INFO
> #For Simple binds
> log4j.logger.org.apache.directory.server.ldap.support.SearchHandler=INFO
> 
> There's more to it if you want to get into the internals.  I would first
> write a simple
> application and make sure you can connect to the server or just use Studio
> to do
> it to confirm it is configured properly and go from there.
> 
> HTH,
> Alex


Re: Logging LDAP requests

Posted by Alex Karasulu <ak...@apache.org>.
On 10/8/07, Olivier Schmitt <sc...@metaintegration.net> wrote:
>
> I am a new user of Apache Directory Server 1.5, and so far I love it!
> It is pretty easy to use and configure, and the Studio UI is nice too.


Cool beans!

Now, I am trying figure out why my business app cannot connect to it.
> In order to better understand what is going wrong, I would like to enable
> logging of LDAP requests coming into the server.


It should not matter but sometimes Windows does odd things with logging
so could you let us know if you're running on windows or not?

As recommended on the page
> http://directory.apache.org/apacheds/1.5/145-configure-logging.html
> I tinkered with the logging parameters, but could not find appropriate
> level
> of detail I am interested in, it would report either nothing, or a huge
> lot
> of things I cant make sense of.


Right you probably set the global log level and that just turned on
everything.

Is there a simple way to set the logging to display something like this?
> - LDAP server received BIND request (+details of bind request)
> - LDAP server received SEARCH request (+details or search request)
>

I would leave the global log level on WARN and add the following lines to
your
log4j.properties then tweak (comment out) them depending on what you're
interested
in:

log4j.logger.org.apache.directory.server.ldap=INFO
#General Frontend Handling
log4j.logger.org.apache.directory.server.ldap.support.bind=INFO
#For SASL binds
log4j.logger.org.apache.directory.server.ldap.support.BindHandler=INFO
#For Simple binds
log4j.logger.org.apache.directory.server.ldap.support.SearchHandler=INFO

There's more to it if you want to get into the internals.  I would first
write a simple
application and make sure you can connect to the server or just use Studio
to do
it to confirm it is configured properly and go from there.

HTH,
Alex