2
public class App {
    //private static final Logger logger = LoggerFactory.getLogger(App.class);
    private static Logger logger = LoggerFactory.getLogger(App.class.getName());
    private static ObjectMapper mapper = new ObjectMapper();

    public static void main(String[] args) {
        Integer port = args.length>0?Integer.parseInt(args[0]): 7000;       
        Javalin app = Javalin.create().port(port).start();      

        app.get("/", ctx -> ctx.result("service working"));     
        app.post("/mhbwebservice", handler);        
    }
}

Can you please advice on how to give log path in javalin framework

Jolta
  • 2,620
  • 1
  • 29
  • 42
  • I think this question is not specific to the Javalin library, so I added the Slf4j and Java tags here. – Jolta Apr 12 '19 at 07:28
  • if you mean path of the file where your log should be stored. Then you should fallow this [link](https://howtodoinjava.com/log4j2/log4j-2-xml-configuration-example/). if this is your requirement and link is not clear let me know. I'll write you an answer – MrDumb Jun 17 '19 at 09:43
  • The link provided by @MrDumb is if you are using Javalin with `Log4j`. Javalin uses `Slf4j` which in turn can use different log implementations. Other common ones are `logback` and `slf4j-simple`. – karmakaze Oct 31 '19 at 03:51

1 Answers1

0

Javalin does not come with a specific logger, you should check the documentation of the logger you're using to configure it.

You can also check the Javalin tutorial on logging.