Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

471
Vistas
Lombok @Log4j2 annotation doesn't work in IntelliJ IDEA

I'm using Lombok library in my project and have a problem with @Log4j2 annotation. Not sure why but it's not generating log field in the class.

But when I'm changing annotation to @Slf4j it works, I can see it in IntelliJ IDEA 'Structure' tab.

I'm using gradle as a build tool. Have few dependencies"

dependencies {
    compileOnly("org.projectlombok:lombok")
    compile("org.springframework.boot:spring-boot-starter-log4j2")
}
over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

So I had the same problem, I think. What I did is I installed the Lombok plugin in IntelliJ, enabled the annotation as in the link under Preferences-> Build, Execution, Deployment > Compiler > Annotation Processors. And then I restarted IntelliJ, and it worked. IDE is able to recognize log.

I tried it for log4j, log4j2 and slf4j. It all worked.

Let me know if this helped.

over 4 years ago · Santiago Trujillo Denunciar

0

Just installing the lombok plugin for intellij works for me.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda