Tomcat logging.properties AsyncFileHandler

2024-11-06 Thread Mcalexander, Jon J.
Question kind people,

Is there ANY AsyncFileHandler property that can handle a MaxSize directive to 
specify the size of the Catalina.out file for log rotation purposes? I see that 
there appears to be a MaxDays, but we would like to rotate based on the size of 
the log file.

Thank you,

Dream * Excel * Explore * Inspire
Jon McAlexander | Senior Infrastructure Engineer | Middleware/App Hosting | FHP 
| CTO | Wells Fargo Technology
8080 Cobblestone Rd | Urbandale, IA 50322 MAC: F4469-010  | +1 515 988 2508 | 
jonmcalexan...@gmail.com
This message may contain confidential and/or privileged information. If you are 
not the addressee or authorized to receive this for the addressee, you must not 
use, copy, disclose, or take any action based on this message or any 
information herein. If you have received this message in error, please advise 
the sender immediately by reply e-mail and delete this message. Thank you for 
your cooperation.



Re: Tomcat logging.properties AsyncFileHandler

2024-11-06 Thread Chuck Caldarale


> On Nov 6, 2024, at 17:12, Mcalexander, Jon J. 
>  wrote:
> 
> Question kind people,
> 
> Is there ANY AsyncFileHandler property that can handle a MaxSize directive to 
> specify the size of the Catalina.out file for log rotation purposes? I see 
> that there appears to be a MaxDays, but we would like to rotate based on the 
> size of the log file.


If you’re running on a real operating system (ie, not Windows), look at the 
description for CATALINA_OUT_CMD in the catalina.sh file along with the man 
page for the Apache rotatelogs utility. (This appears to be installed by 
default on macOS and is included in the apache2-utils package on at least 
Ubuntu-based systems.) There is an optional filesize parameter for rotatelogs 
which should do what you want.

If you are on Windows, there’s always WSL...

  - Chuck


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



RE: [SOLVED] - Tomcat 9.0.96 first start throws java.lang.NullPointerException. Works in the same conditions with 9.0.91.

2024-11-06 Thread Lucian Jurj
> Ok, so the idea is that init() has to be successful or the component will 
> never become started later on.
> Connectors are a bit special though. You can use bindOnInit to do the socket 
> bind and TLS start either in init (you don't want it to fail, and you want 
> the server to start accepting asap) or start (which allows stopping and 
> restarting later, new
> attempts after a failure, and so on).

> I don't know what the best default behavior after getting into a "failed 
> init" state should be for a component. Right now after destroy, it is not 
> possible to go back and simply call init again. I have the impression this is 
> the most reasonable behavior.

> Rémy

Rémy,

We've followed your advice and changed the code on our app side to avoid the 
error loading the connector keystore (i.e.  "java.io.FileNotFoundException: 
C:\Program Files\Neverfail\tomcat\ssl\NFKeyStore.jks (The system cannot find 
the path specified))" 
-> this SOLVED the original reported issue 😊. Now our webapp is working 
correctly, with keystore created before, thus being ready by the time tomcat 
connector "https-openssl-nio-9727" starts.

Here are catalina logs for successful load/init/start:
__
[...]
06-Nov-2024 11:40:28.796 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache 
Tomcat Native library [1.3.1] using APR version [1.7.4].
06-Nov-2024 11:40:28.796 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: 
IPv6 [true], sendfile [true], accept filters [false], random [true], UDS [true].
06-Nov-2024 11:40:28.796 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL 
configuration: useAprConnector [false], useOpenSSL [true]
06-Nov-2024 11:40:28.796 INFO [main] 
org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL 
successfully initialized [OpenSSL 3.0.14 4 Jun 2024]
06-Nov-2024 11:40:29.202 INFO [main] org.apache.coyote.AbstractProtocol.init 
Initializing ProtocolHandler ["http-nio-9728"]
06-Nov-2024 11:40:29.233 INFO [main] org.apache.coyote.AbstractProtocol.init 
Initializing ProtocolHandler ["https-openssl-nio-9727"]
06-Nov-2024 11:40:34.405 INFO [main] 
org.apache.tomcat.util.net.AbstractEndpoint.logCertificate Connector 
[https-openssl-nio-9727], TLS virtual host [_default_], certificate type 
[UNDEFINED] configured from keystore [../ssl/NFKeyStore.jks] using alias 
[nfhb_private_certificate] with trust store [null]
06-Nov-2024 11:40:34.405 INFO [main] org.apache.catalina.startup.Catalina.load 
Server initialization in [6698] milliseconds
06-Nov-2024 11:40:34.452 INFO [main] 
org.apache.catalina.core.StandardService.startInternal Starting service 
[Catalina]
06-Nov-2024 11:40:34.452 INFO [main] 
org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: 
[Apache Tomcat/9.0.96]
06-Nov-2024 11:40:34.468 INFO [main] 
org.apache.catalina.startup.HostConfig.deployWAR Deploying web application 
archive [C:\Program 
Files\Neverfail\tomcat\apache-tomcat-9.0.96\webapps\hbws.war]
06-Nov-2024 11:40:57.830 INFO [main] 
org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application 
archive [C:\Program 
Files\Neverfail\tomcat\apache-tomcat-9.0.96\webapps\hbws.war] has finished in 
[23,361] ms
[...]
__

Thank you for your guidance,
/LJ

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



remote address is localhost after upgrading tomcat instance behind reverse proxy from tomcat8.5 to tomcat9

2024-11-06 Thread Ivano Luberti
Hi, as stated in the subject, we had a correctly behaving tomcat 8.5 
behind a reverse proxy implemented with Apache.


After upgrading to Tomcat 9  every request is seen by tomcat as coming 
from localhost.


Apache and Tomcat are running on the same machine and reverse proxy is 
implemented forwarding the request to localhost.


To say it all, before the upgrade requests arrived to tomcat via ip v4 
and after upgrade via ip v6


I have seen in the doc that there is a filter in tomcat to deal with 
this, but I would like to know why it was working with tomcat 8.5 and 
not with tomcat 9 and if there is a solution properly configuring Apache 
without touching Tomcat


TIA




--

Archimede Informatica tratta i dati personali in conformità a quanto
stabilito dal Regolamento UE n. 2016/679 (GDPR) e dal D. Lgs. 30 giugno 
2003 n. 196

per come modificato dal D.Lgs. 10 agosto 2018 n. 101.
Informativa completa 



Il contenuto di questo messaggio e dei suoi eventuali allegati è 
riservato. Nel caso in cui Lei non sia il destinatario, La preghiamo di 
contattare telefonicamente o via e-mail il mittente ai recapiti sopra 
indicati e di cancellare il messaggio e gli eventuali allegati dal Suo 
sistema senza farne copia o diffonderli. Le opinioni espresse sono 
quelle dell'autore e non rappresentano necessariamente quelle della Società.
This message and any attachment are confidential.If you are not the 
intended recipient, please telephone or email the sender and delete this 
message and any attachment from your system. If you are not the intended 
recipient you must not copy this message or attachment or disclose the 
contents to any other person. Any opinions presented are solely those of 
the author and do not necessarily represent those of the Company.


dott. Ivano Mario Luberti

Archimede Informatica società cooperativa a r. l.
Via Gereschi 36, 56127 Pisa

tel.: +39 050/580959

web: www.archicoop.it
linkedin: www.linkedin.com/in/ivanoluberti
facebook: www.facebook.com/archimedeinformaticapisa/