Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

472
Visualizações
Spring Boot on AWS Elastic Beanstalk and logging to a file

I have been looking to find an easy way to view debug statements on Beanstalk as I develop. I thought I could simply log to a file on Beanstalk.

In my application.properties file I set

logging.file.path=/var/log

And that did not produce any results even on my local machine. I am not sure if it's a permission issue or what, but locally I set the path to my home directory and then I saw the file, spring.log, appear.

With Beanstalk I tried /var/log, var/log/tomcat, /home/webapp/, ./, ~, and various other values. Nothing worked.

I even tried what was suggested here with no luck: https://medium.com/vividcode/logging-practice-for-elastic-beanstalk-java-apps-308ed7c4d63f

If logging to file is not a good idea, what are the alternatives? I have Googled a lot about this issue and all answers are not very clear.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Yes, this is permission issues. Your app runs under webapp user, while /var/log is own by root. Thus you can't write to it.

The proper way of adding your log files to be recognized by EB is through config files.

Specifically, assuming Amazon Linux 2, you can create .ebextensions/mylogfiles.config with the content of:

files: 
  "/opt/elasticbeanstalk/config/private/logtasks/bundle/myapplogs.conf":
    mode: "000644"
    owner: root
    group: root
    content: |
       /var/app/current/log/*.log

Obviously, /var/app/current/log/*.log would point to location where your app stores its log files. /var/app/current is the home folder of your app.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda