Giter Site home page Giter Site logo

Comments (7)

rhuss avatar rhuss commented on September 28, 2024

Both are valid features (having the logs during a run and a dedicated dockers:logs goals for showing the logs on demand and both should of course use the same mechanism.

For the logging mentioned in #8 one would need some extra threads stream out the log as it happenns asynchronously, for docker:logs a single call to the Docker remote API for getting the current log would be enough (but of course something like tail -f would be fine, to)

Also I would like to have all logs from all containers mixed together, with lines coming from different containers higlight somehow (with color and/or prefix). This is also how fig it does.

I already have some ideas how to implement that and this will come quite soon.

from docker-maven-plugin.

jgangemi avatar jgangemi commented on September 28, 2024

oh and here i was ready to take this on...

my logs already contain ansi coloring, so you would need to take that into account (for everyone, not just me) as part of whatever you're thinking of.

from docker-maven-plugin.

rhuss avatar rhuss commented on September 28, 2024

Coloring would be optional, so if you already have colouring one could switch that off (and colouring is switched on only when a TTY is attached). Alternatively a prefix could be configured (a coloured prefix is that what fig uses to print out the tty output).

The tricky part is to parse the chunked response and when printing to the console from multiple threads than some synchronisation is required (i.e. a dedicated thread printing out the log lines coming in from multiple containers line by line).

Also when using as a maven goal, then it should be possible to specify image via -Dimage for which to print out the logs.

I already have some prototype which I polish and add tomorrow. Sorry, I didn't want to take this off from you, but as I said I already have some very concrete ideas. But as soon as it is in, I really would like to get your opinion on this.

from docker-maven-plugin.

jgangemi avatar jgangemi commented on September 28, 2024

lol - i'm not that sad. :)

looking forward to seeing what you've come up with.

from docker-maven-plugin.

rhuss avatar rhuss commented on September 28, 2024

;-)

from docker-maven-plugin.

jgangemi avatar jgangemi commented on September 28, 2024

commenting here b/c this is the correct place ;)

i tried this out a little today and so far so good. the one big piece of feedback do i have is if we (you) want to have some parity w/ docker, the goal should be called logs and not log.

also my first instinct is to type mvn docker:logs given all the other goal names directly match a docker command.

from docker-maven-plugin.

rhuss avatar rhuss commented on September 28, 2024

Good catch. Will change this for the upcoming release 0.10.5

There are still some issues with ordering of log entries from multiple containers, but these will be tackled later on.

from docker-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.