Where are log files when using Spring with built-in Tomcat? - spring

My company uses Spring to provide RESTful service, But I can't find the log files as I usually do(from Tomcat/logs).All I can find is a jar file when Tomcat is built-in. So how can I find the log files?

Following Link will Help you Just check it
http://tutorialspoint.com/spring/logging_with_log4j.htm

Related

How to specify Log4j2 configuration file in spring boot application

I am using log4j2 in my spring boot application. This works in all respects re: excluding slf4j, including log4j2, etc.
But when the application deploys I need to customize the file for each target host. I have created an ansible role that does this. Ultimately I end up with a log4j2.xml file deployed in another directory e.g. /prod/produsrX/data/log4j2.xml.
I am using the spring-boot-maven-plugin "repackage" goal to generate an executable jar file. It doesn't seem like that should matter but it is a data point in the problem.
This was supposed to be the easiest part of the project. Always before I have just been able to set -Dlog4j.configurationFile - advice which is echoed on about 3,000 web pages and DOES NOT WORK in Spring Boot 2.1.3.
The most useful info I've found is this question. It talks about using -Dlogging.config because logging must be initialized before other properties are read. Unfortunately that didn't help either.
I did find one example that suggested specifying the above directory in a -classpath parameter to java. But that didn't help either.
Does anyone know how to get a spring boot application to read the log4j2.xml file?
The property actually has to be put into the application context (e.g. application.yml). Using a -D property does not work!
logging:
config: /prod/produsrX/data/log4j2.xml #fully qualified name to your log4j.xml

JMeter - Test all APIs in the deployed war file

I want to do load testing of all APIs in the deployed war file of my Spring-boot project. Is it possible to configure JMeter to test all APIs in the war ? Or is there a way to programatically get all API names (RequestMapping) in the war file ?
If it is running API already (as you said it is deployed war file) you have to know the endpoints (in case you don't, you have to refer to documentation of API, if you are developer of that API you have to have documentation and of course know the endpoints, for documentation refer to here https://www.blazemeter.com/blog/how-to-automatically-document-api-endpoints-via-swagger as a starter)
When you find out the information about your endpoints (endpoints, authentication, expected body in case of post, accepted content type and etc) you can use JMetter UI and create your scenarios and also, you can refer to BlazeMeter and get much more help in real time.
Hope it answered your question and solved your problem

Can't find spring integration aws schema location online

I can't find
http://www.springframework.org/schema/integration/aws/spring-integration-aws.xsd
under
http://www.springframework.org/schema/integration/
Any help?
You shouldn't care about that these days. The normal IDEs are able to resolve XSD against classpath, reading the content of the jars you provide for your project.
That schema is located here: https://github.com/spring-projects/spring-integration-aws/tree/master/src/main/resources/org/springframework/integration/aws/config

How to use logback for several web apps on Tomcat7?

I can successfully configure logback for a single web app and deploy it to Tomcat7 with the dependent jars in WEB-INF/lib. Then, when I move my dependent jars to the lib folder in CATALINA_HOME, it seems that the logback.xml config file is not found. I have a separate logback.xml file for each web app, sitting in the classes folder of each deployed war file. I have separate logback config files for each web app because I want each web app logging to a different rolling file appender, if possible. With some quick google searches, I failed to find documentation for this style of setup. Can anyone point me to a helpful resource, or just some good advice?
My boss, Venu, solved this problem yesterday by following a hunch. I suggested that he try to force tomcat to use logback for all of its logging, and then we may be able to control our logging in each of the web apps. When he tried that, it worked great. We then decided we did not need to log to different files for each web app because we can grep by the logger name, as our logging pattern includes it. A google search finds plenty of blog posts on how to force tomcat7 to use logback.

What is the best way to design file handling using spring

I want to make an application is which file handling is used. That is file downloading (get the file), file parsing(process the file) and file uploading. It is not a web project. Actually the idea is we make this project and then make a jar of it and then use it in our further projects. How can i design my application so it is extendable easily in future. Is there is any spring framework for this task?
Thanks
I would suggest either Spring Batch or Apache Camel. These two frameworks can automate the downloading/uploading functionality you are after and let you define the file parsing in a well structured manner. If you are after csv or line-by-line parsing it's already done for you and you'll be at the file parsing bit just with a few configuration. Take a look at the Spring Batch sample examples and Apache Camel examples as a starting point.

Resources