[
https://issues.apache.org/jira/browse/VFS-270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735826#action_12735826
]
Ralph Goers commented on VFS-270:
---------------------------------
You have not convinced me. While I'm not the only committer who could change
this, and I certainly wouldn't veto a fix that does, I still think what VFS is
doing is appropriate.
If you look at http://commons.apache.org/logging/guide.html#Quick%20Start you
will see how Commons Logging determines what logging framework to use. If you
have log4j in the classpath it will be used. If log4j isn't there and you are
on a JDK 1.4 or greater JVM then the java.util.logging is being used. If not,
then commons logging's SimpleLog.
For SimpleLog, just add
System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "warn");
to your application or add
-Dorg.apache.commons.logging.simplelog.defaultlog=warn to the script that
invokes your command line tool.
If java.util.logging is being used then the instructions are at
http://java.sun.com/j2se/1.5.0/docs/api/java/util/logging/LogManager.html. You
can copy the default logging.properties file and change its default from info
to warn and then setting the "java.util.logging.config.file" property to point
to that file. Another way to handle this is do
LogManager.getLogManager().getLogger("org.apache.commons.vfs").setLevel(Level.WARN);
Or you can just put the log4j jar in your classpath. I don't think it logs
anything by default.
> Don't log VFS internal info unless vital
> ----------------------------------------
>
> Key: VFS-270
> URL: https://issues.apache.org/jira/browse/VFS-270
> Project: Commons VFS
> Issue Type: Improvement
> Affects Versions: 1.0
> Environment: Occurs for me under JDK 1.6 with 32 bit Linux, but
> presume everywhere.
> Reporter: William Pietri
> Priority: Minor
>
> Please change VFS's default behavior so that it by default no longer produces
> programmer-focused info to stdout.
> My situation is that I'm building a command-line tool. I'm using VFS because
> a) the Java file API is somewhat awkward, and b) I wanted to have my tool run
> in a dry-run mode, where it uses an in-RAM filesystem that gets discarded.
> Even when operating purely on local files, my command-line script produces
> this output:
> Jul 27, 2009 1:00:02 PM org.apache.commons.vfs.VfsLog info
> INFO: Using "/tmp/vfs_cache" as temporary files store.
> Surely, that's interesting to VFS developers. And maybe that's interesting to
> me as a developer using the library, although it makes me wonder why it's
> creating temporary files while doing local file access. But that's definitely
> not interesting to the users of my tool, especially ones who put it in a cron
> job, getting regular mail that contains only this.
> My suggestion is twofold:
> 1) Change the default logging levels so that they're tuned to the interests
> of a typical app consumer, rather than a developer. This message, for
> example, should be at DEBUG level rather than INFO level.
> 2) Optionally, allow developers who'd like more verbose logging of VFS
> internals an easy way to say so.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.