0

Need to know where can I specify the spring boot port aa when I check my service status I get this:

"Serverkt.log started at server-name with process id" But I don't get the port number. Also wanted to know where I can find the spring logs in the server

viraj
  • 129
  • 9
  • Possible duplicate of [How to configure port for a Spring Boot application](https://stackoverflow.com/questions/21083170/how-to-configure-port-for-a-spring-boot-application) – Romil Patel Apr 02 '19 at 12:39

2 Answers2

2

spring boot has its configuration file. I guess that you have it included in your jar/war file. So basically unzip that file and look inside it (try to search for application.properties or application.yaml|yml).

property server.port defines the port on which application is running. It defaults to 8080. If you are using spring-boot 2 then with property logging.path you can change the path where output file will be placed. However I don't know if this works when you have logback/log4j/... configuration.

if you run your application you can override those properties specified in appplication.properties|yaml by providing command line properties. For example you can change the port with command java -jar your-boot.jar --server.port=9090

bilak
  • 4,526
  • 3
  • 35
  • 75
1

Since you're starting spring boot from a service file, you can set the port using command line arguments e.g.port 8083 would look like this:

ExecStart=/usr/bin/java -jar /opt/corda/spring.jar --server.port=8083
Cais Manai
  • 966
  • 1
  • 9
  • 20