oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.33k stars 746 forks source link

logging to file message should be more clear (Bugzilla #17506) #486

Closed vladak closed 5 years ago

vladak commented 11 years ago

status CAUSEKNOWN severity minor in component indexer for --- Reported in version unspecified on platform ANY/Generic Assigned to: Lubos Kosco

On 2010-12-02 12:03:16 +0000, Vladimir Kotal wrote:

Indexer says the following:

Refreshing OpenGrok indexes Loading the default instance configuration ... Logging to file: /opengrok/log/opengrok%g.%u.log

The last line is incorrect. It should either say to which file it is currently logging or the message should say something like 'Using log file format: ...'.

The former would be more useful, I think.

On 2010-12-02 12:22:02 +0000, Lubos Kosco wrote:

http://download.oracle.com/javase/6/docs/api/java/util/logging/FileHandler.html

the best I can do is to print out it's the logging filehandler pattern

it seems I cannot interpret it using official methods ... :(

default %g and %u mean:

  • "%g" the generation number to distinguish rotated logs
  • "%u" a unique number to resolve conflicts

so it will say:

Loading the default instance configuration ... Logging filehandler pattern: : /opengrok/log/opengrok%g.%u.log

On 2010-12-02 12:25:49 +0000, Lubos Kosco wrote:

well I can actually remove %g from default pattern and maybe I can do something evil like: .replaceAll("%u", "0")

which will obviously work for default pattern, will break for user pattern and will print bullshit if there will be a conflict and %u will change from 0 to X

I love java :)

On 2010-12-02 12:28:16 +0000, Vladimir Kotal wrote:

(In reply to comment # 2)

well I can actually remove %g from default pattern

yes please.

and maybe I can do something evil like: .replaceAll("%u", "0")

which will obviously work for default pattern, will break for user pattern and will print bullshit if there will be a conflict and %u will change from 0 to X

I love java :)

So there is no way how to get user ID in Java ?

v.

On 2010-12-02 12:55:17 +0000, Lubos Kosco wrote:

(In reply to comment # 3)

(In reply to comment # 2)

well I can actually remove %g from default pattern

yes please.

and maybe I can do something evil like: .replaceAll("%u", "0")

which will obviously work for default pattern, will break for user pattern and will print bullshit if there will be a conflict and %u will change from 0 to X

So there is no way how to get user ID in Java ?

sorry for confusion, %u is not user, but unique id to avoid writer conflicts (e.g. 2 indexers accidentally started at the same time will this way not overwrite each other logs)

so above depends on whether the file is writeable(and unlocked for write) and depends on instance, but instance is not able to report the file name opened ... seems I will have to file a bug against JDK/JRE

L

On 2011-01-05 08:43:05 +0000, Knut Anders Hatlen wrote:

Resetting target milestone since this won't make it into 0.10.

tulinkry commented 5 years ago

Can be closed, indexer prints "System.out.println("Logging filehandler pattern: " + fn);"