Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging #940

Open
ChristianGruen opened this issue Apr 24, 2014 · 5 comments
Open

Logging #940

ChristianGruen opened this issue Apr 24, 2014 · 5 comments
Milestone

Comments

@ChristianGruen
Copy link
Member

Send stdout and stderr output to loggers, such as Log4J. If no loggers are found, output should stay as is.

@ChristianGruen
Copy link
Member Author

Issues to solve:

  • If the BaseX command-line interfaces are run (basex, basexclient, basexgui?), output should probably always be directed to standard out/err. This could e.g. be solved by an additional flag that indicates if loggers should be ignored.
  • Things are getting difficult with basexserver, which can both be run as service and as interactive tool (via -i).

@mgaerber
Copy link

Since BaseX usage can not (and maybe better should not) predicted (lib vs tool vs dbms...), I propose adding hooks or annotations so it would be possible to introduce such functionality on another level. E.g. aspectj could be one way of allowing different "flavors".

@ChristianGruen ChristianGruen added this to the HOLD milestone Dec 7, 2016
@ghost
Copy link

ghost commented Jul 19, 2017

Rergarding the .logs directory in the GUI, i wonder why there are no entries appearing when execution a (HTTP) query? is there anything to set?

@BenoitMaisonny
Copy link

I don't really see why some BaseX applications should write to the console: BaseX is not a small command-line tool. Are there other tools that depend on this console output? Using System.err/out is discouraged, except of course for pure command-line tools.

Would anyone really need console output, Log4J (and probably other loggers as well) can be configured to log to standard error/output.

The opposite, redirecting System.err/out to a logger, is possible also, so it's not a big deal and it's quite understandable if BaseX developers find more interesting issues to tackle ;-) It looks like System.err/out is only used in org.basex.util.Util, in 2 places, so I can propose a patch if you are interested.

My problem with BaseX writing to System.err is that a BaseX message is sometimes output in the middle of a log message when the logger outputs to the console. Context: BaseXServer embedded in a Java application, running as a JUnit unit test within Eclipse. I suppose it would not be a problem in a real application.

@ChristianGruen
Copy link
Member Author

Hi @BenoitMaisonny, thanks for your offer; pull requests are always welcome. I guess one challenge will be to preserve the CLI features of BaseX (i.e. to decide when output to stdout is appropriate and when not).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants