AJ Weber | 2 Dec 05:48
Favicon

SocketHubAppender can not bind on Solaris?

I'm trying to startup a SocketHubAppender on Solaris 9.  All my other, local/file logging works great.

  I check if a port is in-use, and find an open one -- take 12001 for example.

  So I configure my appender and port, then try starting my java application.  But it almost immediately comes
back with a java.net.BindException: Address already in use!  But it wasn't a second ago!  Is this a
Solaris-specific problem anyone has seen before?  I think the host may be using NIS+, could that be
blocking my binding to it?

  Thanks in advance for any info/help!

  -AJ
Dipocse | 1 Dec 10:26

Re: initialize the log4j system properly


I'm still stacked. Please would anyone help me to solve the issue?

Dipocse wrote:
> 
> Hi All
> I've a database (PRJ) and I'm trying to connect from Asterisk server to
> that database. In the shell script i used a log4j-1.2.11.jar with all
> others jar files. 
> 
> The shell script for runagi.sh is :
> 
> #!/bin/sh 
> 
> JARS="curtin.jar:/lib/log4j-1.2.11.jar:/lib/jta.jar:/lib/antlr-2.7.6rc1.jar:/lib/ehcache-1.1.jar:/lib/cglib-2.1.3.jar:/lib/dom4j-1.6.1.jar:/lib/mail.jar:/lib/commons-lang-1.0.1.jar:/lib/mysql-connector-java-3.1.10-bin.jar:/lib/asm-attrs.jar:/lib/commons-logging-1.0.4.jar:/lib/commons-collections-2.1.1.jar:/lib/mailet_1_0.jar:/lib/asterisk-java-0.2.jar:/lib/jdom.jar:/lib/rome-0.7.jar:/lib/asm.jar:/lib/hibernate3.jar:/lib/activation.jar:/lib/c3p0-0.9.0.jar"
> 
> 
> RUNCLASS="curtin.control.VAEAGIServer"
> 
> 
> export VAECONFIG="/vad/VAE.conf"
> 
> 
> echo "Script: Removing old log files"
> 
> rm -f ./logs/VAEServer.log
> rm -f ./logs/ChannelSessionManager.log
> rm -f ./logs/ThreadManager.log
> 
> echo "Script: Deleting old dynamic audio files"
(Continue reading)

Ceki Gulcu | 27 Nov 19:56
Favicon

Re: Repository selectors, useful?


Thanks for your response. Comments inline.

Jacob Kjome wrote:
> Hi Ceki,
> 
> Can you please explain your change of heart first?  I'll take a guess as to your
> skepticism...

> 1.  Very little built in support, making repository selectors generally a custom
> solution, which inhibits widespread use.  This can be easily addressed.

What do you mean by "very little built in support"? Do you mean in log4j or in 
application containers. If the latter, then this cannot be easily addressed.

> 2.  The use of static loggers as well as logger abstractions such as
> commons-logging and SLF4J (unless you use an implementation that directly extends
> SLF4J, such as Logback) break respository selectors anyway.

True.

> 3.  Even implementations that purport to support respository selectors fail to
> truly support them in practice as evidenced by the fact that Logback - having been
> in full release for a good while - is just now being fixed to properly support them.

The problem was actually in SLF4J.

> 4.  A common deployment model these days is one app per/server.  In this case,
> separating logging between applications is unnecessary because there is only one
> application.
(Continue reading)

Jacob Kjome | 27 Nov 19:39
Favicon

Re: log4j ignoring log4j.properties and only showing INFO messages

Try using -Dlog4j.debug=true to see how Log4j is being configured.  Maybe someone
is performing manual configuration shortly after auto-configuration takes place?

Jake

On 11/26/2008 3:54 PM, Farrukh Najmi wrote:
> I have been using log4j 1.2.14 and commons-logging 1.1 in my project
> successfully for a long time.
> All of a sudden I am finding that my log4j.properties file can no longer
> control logging behavior
> for log4j. The only messages that are logged are INFO messages.
> 
> Since my project is a maven project with many direct and indirect
> dependencies its possible that one of those dependencies changed in some way
> to change my apps logging behavior.
> 
> I have tried specifying my log4j file explicitly using system property:
> 
> -Dlog4j.configuration=file:///somedir/log4j.properties
> 
> No joy with that. Expected trace messages till did not appear.
> 
> Then I wondered perhaps the problem is in commons-logging so I tried to turn
> diagnostic on in common-logging using system property:
> 
>  -Dorg.apache.commons.logging.diagnostics.dest=somefile.txt
> 
> Still no joy. No file was created.
> 
> What could be wrong and how can I debug this further?
(Continue reading)

Dipocse | 27 Nov 03:50

initialize the log4j system properly


Hi All
I've a database (PRJ) and I'm trying to connect from Asterisk server to that
database. In the shell script i used a log4j-1.2.11.jar with all others jar
files. 

The shell script for runagi.sh is :

#!/bin/sh 

JARS="curtin.jar:/lib/log4j-1.2.11.jar:/lib/jta.jar:/lib/antlr-2.7.6rc1.jar:/lib/ehcache-1.1.jar:/lib/cglib-2.1.3.jar:/lib/dom4j-1.6.1.jar:/lib/mail.jar:/lib/commons-lang-1.0.1.jar:/lib/mysql-connector-java-3.1.10-bin.jar:/lib/asm-attrs.jar:/lib/commons-logging-1.0.4.jar:/lib/commons-collections-2.1.1.jar:/lib/mailet_1_0.jar:/lib/asterisk-java-0.2.jar:/lib/jdom.jar:/lib/rome-0.7.jar:/lib/asm.jar:/lib/hibernate3.jar:/lib/activation.jar:/lib/c3p0-0.9.0.jar"

RUNCLASS="curtin.control.VAEAGIServer"

export VAECONFIG="/vad/VAE.conf"

echo "Script: Removing old log files"

rm -f ./logs/VAEServer.log
rm -f ./logs/ChannelSessionManager.log
rm -f ./logs/ThreadManager.log

echo "Script: Deleting old dynamic audio files"
rm -f /var/lib/asterisk/sounds/TMP*.gsm

java -cp $JARS $RUNCLASS NOWAVE

when i run the above shell script (./runagi.sh). It shows me the following
warnings........

(Continue reading)

Andy Rozman | 26 Nov 19:05

calling logger from one location (method)

Hi !

I have one weird request... I would like to call log from one certain
method. Problem is that I need logging output to be sent to my gui as
well as into log file (some logs not all), so I wanted to create method
that would call logger... something like this:

public void writeLog(int type, String msg)
{
     // some my code

     if (type==DEBUG)
     {
          log.debug(msg);
     }
     // some more code and if conditions

}

Problem is that whenevr I write to log through this method I get as
source this method. Would it be possible to make so, that logger writes
as source originating method.

Thank you for all answers...
Andy
manish_goyal | 25 Nov 11:31
Favicon

Is that possible to split values from (%m) message object in log4j.properties file


Hi,

 I am using log4j.properties file to log data into database. I am setting
multiple values in a JAVA file using different Logger.info(“value”).  

In log4j.properties file, when I am using %m to insert values in database,
it’s inserting all values in a single column.
I want to put values from %m into different column.

Is there any way to split values into different column?

Is this possible?

Any pointers would be greatly appreciated.

Thanks.

Regards,
Manish
--

-- 
View this message in context: http://www.nabble.com/Is-that-possible-to-split-values-from-%28-m%29-message-object-in-log4j.properties-file-tp20678599p20678599.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
WJCarpenter | 23 Nov 19:20

Re: Can we define multiple Logger instance in a single class file?


> If it is possible then what will be the value for "?". Logger myLogger =
> Logger.getLogger("?"); in java file.
> and for referring the same Logger instance in log4j.properties file, how we
> will be defining the Appender.
>   

You can call your loggers whatever you want.  Naming them after fully 
qualified class names is just a convention (and, a convention that time 
has shown is often not that great an idea if your logging is exposed to 
end users who have no idea about the internal organization of your code).
Dong Zhang | 21 Nov 02:45
Favicon

RE: How to log ip addresses?

Hi Lynn,

I have no idea about uPortal, but for log4j, it has no application
specific configuration, e.g. username, ip address, etc.

The reason you see username, is uPortal application logged it. So if you
want ip address, you need to look into uPortal doc/configuration files,
instead of log4j configuration.

Dong

-----Original Message-----
From: Poythress, Lynn [mailto:apoythre <at> skymail.csus.edu] 
Sent: Friday, November 21, 2008 6:56 AM
To: log4j-user <at> logging.apache.org
Subject: How to log ip addresses?

Hi,

We are running Unicon's uPortal product.  It utilizes log4j and we have
a log4j.properties file which creates a portal.log file.  In that
portal.log file it logs users that log on to the portal.  We would like
it to log the ip address of each user; currently it just shows user name
and userid.

Do we modify the log4j.properties file to have it add each user's ip
address to the log?

If so, can you point me in the right direction?  I read about appenders,
but couldn't see any parameters that would specifically capture ip
(Continue reading)

| 19 Nov 14:47

Rolling logs to custom folder

Hi all,

I'm trying to find some configuration/appender that as the capability to
roll log files to a custom folder. I have searched on google and on the
log4j mailing lists but i haven't find any information on this issue. If
someone could point me any reference/link/appender to resolve this problem
it would save me a lot of time.

Cheers,
André Lopes

Re: Error while loading OracleDriver

manish_goyal skrev  den 19-11-2008 12:11:
> Hi,
>
> I am sending message to JMS queue using java application. From there i am
> using log4j.properties file for logging message to File and Database. I have
> added ojdbc.jar and JDBCAppender.jar file in dependency.
> I am able to log in to file, but for DataBase i am getting following error:-
>
> log4j:ERROR Failed to load driver
> java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
>   
Is the Oracle JDBC driver available in the classpath for the class 
trying to log using JDBCAppender?

--

-- 
  Thorbjørn Ravn Andersen  "...plus... Tubular Bells!"

Gmane