g format(LogRecord record) {
String webappName = LogManager.getLogManager()
.getProperty(OneLineFormatter.class.getName() +
".webappName"); // ".hostName", ".serviceName", ".catalinaBase"
return String.format("%s/n",
.getProperty(OneLineFormatter.class.getName() +
".webappName"); // ".hostName", ".serviceName", ".catalinaBase"
return String.format("%s/n", webappName); // only application
name for testing
}
}
in $CATALINA_BASE/co
r.class.getName() +
".webappName"); // ".hostName", ".serviceName", ".catalinaBase"
return String.format("%s/n", webappName); // only application
name for testing
}
}
in $CATALINA_BASE/conf/logging.properties:
my.log.formatter.MyCust
atalina.base}/conf/logging.properties
> > file:
> >
> > ...
> > org.apache.tomee.jul.formatter.AsyncConsoleHandler.level = FINE
> > org.apache.tomee.jul.formatter.AsyncConsoleHandler.formatter =
> > my.log.formatter.OneLineFormatter
> > org.apache.tomee.jul.formatter.Asy
y... Maybe there
any other way, to get servlet context from InitialContext or application
name from LogManager property:
java.util.logging.LogManager.getLogManager().getProperty(...)
Do you know desired property or how to list LogManager properties?
10.01.2022 12:53, Mark Thomas пишет:
U
mee.jul.formatter.AsyncConsoleHandler.level = FINE
org.apache.tomee.jul.formatter.AsyncConsoleHandler.formatter =
my.log.formatter.OneLineFormatter
org.apache.tomee.jul.formatter.AsyncConsoleHandler.encoding = UTF-8
...
Looks like, I cannot access to ServletContext directly... Maybe there
any other way, to get servlet con
Use ServletContext.getContextPath()?
If you have a more complex deployment you might want to preface it with
ServletContext.getVirtualServerName()
Mark
On 10/01/2022 05:00, Makarov Alexey wrote:
Hello! I want to print application name in my log files. As I know, I
must implemet custom log
Hello! I want to print application name in my log files. As I know, I
must implemet custom log formatter. How I can get application name?
import java.util.logging.Formatter;
import java.util.logging.LogRecord;
public class MyCustomLogFormatter extends Formatter {
@Override
public String
Subject: Re: session not working when dash or underscore in application name
>
> Thanks, maybe the problem has been solved in 7.0.34, I'll try that
> version later
> in the meantime I simply removed all dashes and underscores, and
> everything works fine
>
> L
Thanks, maybe the problem has been solved in 7.0.34, I'll try that
version later
in the meantime I simply removed all dashes and underscores, and
everything works fine
Le 19/01/2013 20:52, Christopher Schultz a écrit :
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
To whom it may concern,
O
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
To whom it may concern,
On 1/19/13 7:15 AM, Benin Technologies wrote:
> I just installed Tomcat 7.0.32 on Debian Linux 6 (Squeeze). Client
> is Mozilla Firefox 12.0, also on Debian Linux 6.
>
> To test session behavior, I did a simple JSP page that
Hi,
I just installed Tomcat 7.0.32 on Debian Linux 6 (Squeeze). Client is
Mozilla Firefox 12.0, also on Debian Linux 6.
To test session behavior, I did a simple JSP page that simulates a coin
launch (heads or tales), and displays the total of heads and total of tails.
If my war file is call
then I get an error message:
javax.naming.NameNotFoundException: Name [app/AppName] is not bound
in this
Context. Unable to find [app].
In the manager application of Tomcat I see both names in the
application
list.
I was able to use this in Glassfish. There I could define a
application name
i
ame] is not bound in this
Context. Unable to find [app]./
In the manager application of Tomcat I see both names in the application
list.
I was able to use this in Glassfish. There I could define a application name
in the console when I deployed the application. Is it also possible with
Tomcat or do
t; /javax.naming.NameNotFoundException: Name [app/AppName] is not bound in this
> Context. Unable to find [app]./
>
> In the manager application of Tomcat I see both names in the application
> list.
>
> I was able to use this in Glassfish. There I could define a application name
n I get an error message:
/javax.naming.NameNotFoundException: Name [app/AppName] is not bound in
this Context. Unable to find [app]./
In the manager application of Tomcat I see both names in the application
list.
I was able to use this in Glassfish. There I could define a application
name in t
asaf.lahav wrote:
> How can I obtain the name of the web application name my listener servlet is
> running under in Java?
There is no such thing as a listener servlet but there are a bunch of
different Listener classes. Which one are you trying to use?
ving the display name element
>(MyAppName) defined in the web.xml file.
>
>
>
>I would like to know if anyone has a better idea.
>
>Potentially the display name may be changed and not reflect the actual web
>application name.
>
>
>
>-Original Message-
>Fro
display name may be changed and not reflect the actual web
application name.
-Original Message-
From: David Delbecq [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 05, 2006 2:19 PM
To: Tomcat Users List
Subject: Re: web app application name
asaf.lahav wrote:
>
>
> How can
when configured
semi-programmatically. I gave up in the end.
David Delbecq wrote:
> asaf.lahav wrote:
>
>>
>>
>> How can I obtain the name of the web application name my listener
>> servlet is
>> running under in Java?
>>
>&
asaf.lahav wrote:
How can I obtain the name of the web application name my listener servlet is
running under in Java?
request.getContextPath();
Greetings.
-
To start a new topic, e-mail: users@tomcat.apache.org
To
AFAIK, it depends on the listener. Listeners implementing
ServletRequestListener can retrieve it from the request; for others I
don't see a clear way.
--David
asaf.lahav wrote:
How can I obtain the name of the web application name my listener servlet is
running under in
How can I obtain the name of the web application name my listener servlet is
running under in Java?
How can I obtain the name of the web application name my listener servlet is
running under in Java?
24 matches
Mail list logo