Thanks, already solved!
You are right, the double quotes are mandatory. But in this case, to avoid variable expansion (in bash), need also to escape the dolar signs.
And finally, the format need to be surrounded by single quotes.

What did I accomplish? The end of double log lines in log file :-)

My catalina.out now looks like:

[2013-01-30 19:22:35.593] Informações: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib [2013-01-30 19:22:36.233] Informações: Initializing ProtocolHandler ["http-bio-80"]
[2013-01-30 19:22:36.253] Informações: Initialization processed in 1396 ms
[2013-01-30 19:22:36.322] Informações: Starting service Catalina
[2013-01-30 19:22:36.324] Informações: Starting Servlet Engine: Apache Tomcat/7.0.35 [2013-01-30 19:22:36.336] Informações: Deploying web application archive /opt/apache-tomcat-7.0.35/webapps/Studi.war

Which is much more readable than the old format:

Jan 30, 2013 4:40:13 PM org.apache.catalina.core.AprLifecycleListener init
Informações: The APR based Apache Tomcat Native library which allows optimal performance in production environme nts was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Jan 30, 2013 4:40:15 PM org.apache.coyote.AbstractProtocol init
Informações: Initializing ProtocolHandler ["http-bio-8080"]
Jan 30, 2013 4:40:15 PM org.apache.coyote.AbstractProtocol init
Informações: Initializing ProtocolHandler ["ajp-bio-8009"]
Jan 30, 2013 4:40:15 PM org.apache.catalina.startup.Catalina load
Informações: Initialization processed in 3933 ms


and so on...



Em 30/01/2013 20:26, Mark Eggers escreveu:
On 1/30/2013 2:01 PM, Edson Richter wrote:
I'm trying to put the following in catalina.sh:

JAVA_OPTS=-Djava.awt.headless=true
-Djava.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td
%1$tH:%1$tM:%1$tS.%1$tL] %4$s: %5$s %6$s %n

also tried:

JAVA_OPTS="-Djava.awt.headless=true
-Djava.util.logging.SimpleFormatter.format=[%1$tY-%1$tm-%1$td
%1$tH:%1$tM:%1$tS.%1$tL] %4$s: %5$s %6$s %n"


Both causes errors (linux platform) like

"/etc/init.d/catalina: line 64:
-Djava.util.logging.SimpleFormatter.format=[%1-%1-%1: command not
found"

or

"Error: Could not find or load main class %1:%1:%1.%1]"


I'll appreciate your help.

Edson Richter

What version of Tomcat? Please give the full version (x.y.z).

What are you trying to accomplish?

Did you put a copy of catalina.sh as catalina in /etc/init.d or is this a third party distribution? I've not seen one that places catalina.sh as catalina in /etc/init.d, but I've not worked a lot with repackaged Tomcats.

Probably the best way to handle this is find out where your distribution thinks $CATALINA_HOME is, and then edit a setenv.sh file in $CATALINA_HOME/bin to include environment variables.

This file is not included by default - you'll have to create your own.

Also, when you enter multiple values for an environment variable, you'll have to surround the entire thing with quotes. For example:

JAVA_OPTS="-Dfoo=something -Dbar=else"

This all assumes that your distribution (if you're using one) hasn't mangled catalina.sh and removed references to setenv.sh.

. . . . more guesses with more information
/mde/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to