Fork me on GitHub

@ddeaguiar The way pedestal logging works is annoying as a library it should provide some means to customize its logging. Also it's hard to find what you what in those huge strings


@lxsameer re: log customization, the pedestal.log library is just a wrapper around the slf4j-api. Pedestal services created via the pedestal-service lein template have a dependency on logback. Logging is configurable via the logback.xml config file. Is there something specific you are having trouble configuring?


@lxsameer re: viewing the logs, I recommend using lnav ( I’ve created a lnav formatter based on the lnav java formatter. You may find it useful.


@ddeaguiar yeah. As a library it would be nice for pedestal to instead of logging hand the logs to the user to handle and has a default handler . I know that sl4j is a wrapper and i can use other logger backend to setup my logging


@ddeaguiar but that's not the case , because for example for my current use case, i don't want pedestal logging, so I have to either blacklist the namespace in my logger or change the way of logging


but if pedestal instead of logging directly just send the log data to a function provided by the user


If I understand correctly, you don’t want to see logging for any pedestal namespace, correct?


it would be much easier to handle


@ddeaguiar no, just some of them


Ok, so you’ve already mentioned one option which is to update your log config to suppress logging from specific namespaces.


I personally find that to be a satisfactory solution. However, there is another option


You can create your own logging implementation and plug it into Pedestal. All you have to do is implement a protocol


Check out the ns doc-string for details on how to configure that:


I think that provides the flexibility you are looking for


yeah it does . I'll return with my idea about how pedestals logging should be as soon as i done with it, It much easier to communicate via code 🙂


Sure! Glad to help and looking forward to seeing what you come up with 🙂


@ddeaguiar are you a contributor to pedestal ?


I’ve contributed but I’m not a core contributor


How do i point pedestal app to an external logback.xml file?


@vijayakkineni the log config needs to be on the classpath. If adding the config file to the resources dir does not suit your needs, you should be able to add the file to the classpath when starting the service. I suspect this can be done via java -classpath ... but I don’t have first hand experience with it.