huxi / lilith

Lilith is a Logging- and AccessEvent viewer for Logback, log4j, log4j2 and java.util.logging
http://lilith.huxhorn.de
GNU Lesser General Public License v3.0
137 stars 18 forks source link

Make ports configurable #10

Open janArb opened 10 years ago

janArb commented 10 years ago

I want to use the same log configuration for different log viewers, but cannot change the ports to listen to. Neither in Logback Beagle nor in Lilith. Why do all make this hardcoded? Of course one can change that in logback.xml and even add two socket appenders (stupid), but what if e.g. other services use the same ports? Never seen applications where ports cannot be changed. Maybe I'm missing something?

huxi commented 10 years ago

Nope, this is currently indeed hardcoded. And it's also a bit embarrassing that this is the case.

The thing is that I would like to perform some serious refactoring in that part of Lilith (e.g. using netty as the network backend) - but I'm a bit occupied at the moment. I'd rather not add a UI for this right now, especially since I'm not just listening for one type of event but 14. This could end in a configuration nightmare if done hastily instead of in a sensible way.

So I currently go for "use a well-documented hardcoded port". This is arguably also laziness on my part since it's easier to support if questions arise.

But rest assured that this is on my todo list. I just can't give you any timings.

janArb commented 10 years ago

I don't know who and why else uses Lilith, but my usecase and I believe that's where users hear of Lilith is Logback SocketAppender. So if you could at least make that one port configurable meanwhile? Or add an special option to change that port to the Logback/Beagle default one. This is also the most elegant Logback configuration, as this snippet (without port configuration) is enough for logback:

<configuration debug="true">
  <!-- sends logs to logback-beagle -->
  <consolePlugin />
</configuration>

This sends logs to port 4321, which is also hardcoded in Beagle doh!...

huxi commented 10 years ago

I'll consider that option. Wouldn't be enabled by default, though, since a running Lilith would otherwise prevent Beagle from working. I wasn't aware of that configuration shortcut.