I am trying to write System.out.print statement in log file
I use the following application.properties file
logging.level.org.springframework.web=INFO
logging.level.org.hibernate=ERROR
logging.level.com.cirq.configurator=INFO
logging.path=${mypath}
logging.file=filename.log
By default, Spring Boot will only log to the console and will not write log files. If you want to write log files in addition (emphasis added) to the console output you need to set a logging. file or logging. path property (for example in your application.
The stdout. log file is a console logging file that has poor log management which causes the file to grow too large. PROBLEM DESCRIPTION. From PingFederate 9.0 onwards: 1) If an OS service start up script is being used or <pfinstall>/sbin/pingfederate-run.sh, output can be sent to stdout.
if you are deploying .jar file in undertow application server, then System.out.print statement will not work(means it will not write in log file).
For that you have to use log4j which is in-built in Spring Boot.
Example:
final static Logger logger = LoggerFactory.getLogger(YourController.class);
logger.info("Your print statement");
Refer link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With