I have a tomcat app on AWS Elastic beanstalk , As advised here I am using the Environment Properties to set the jdbc connection to database, this parameter includes the user and password for the database. The thing is, the tomcat logger is logging all parameters on its startup , It looks something like this
INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -DJDBC_CONNECTION_STRING=jdbc:mysql:///localhost:3306/mydatabase?user=me&password=mypassword
I don't want this sensitive data to be on the instance logs. How can I tell Tomcat not to log the command line arguments? {or any other secure solution for the problem}
Update: So it seems like removing the line from Tomcats server.xml does the trick on my local tomcat (Thanks cyril)
But how do I set this up on Elastic Beanstalk? I tried to create a script in .ebextensions folder with variation on this but it did not work for me the arguments are still logged. But I am not sure I am using windows and not very familiar with linux scripting. Maybe someone can help me create that script correctly? how can I check if the script ran on the elastic beanstalk instance and if the server.xml changed?