本文整理汇总了Java中org.apache.log4j.helpers.OptionConverter.toFileSize方法的典型用法代码示例。如果您正苦于以下问题:Java OptionConverter.toFileSize方法的具体用法?Java OptionConverter.toFileSize怎么用?Java OptionConverter.toFileSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.log4j.helpers.OptionConverter
的用法示例。
在下文中一共展示了OptionConverter.toFileSize方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setMaxFileSize
import org.apache.log4j.helpers.OptionConverter; //导入方法依赖的package包/类
public void setMaxFileSize(String value) {
if (value == null) {
LogLog.warn("Null max file size supplied for appender [" + this.getName() + "], defaulting to " + this.getProperties().getMaxFileSize());
return;
}
value = value.trim();
if ("".equals(value)) {
LogLog.warn("Empty max file size supplied for appender [" + this.getName() + "], defaulting to " + this.getProperties().getMaxFileSize());
return;
}
final long defaultMaxFileSize = this.getProperties().getMaxFileSize();
final long maxFileSize = OptionConverter.toFileSize(value, defaultMaxFileSize);
this.getProperties().setMaxFileSize(maxFileSize);
}
示例2: setMinFreeDiskSpace
import org.apache.log4j.helpers.OptionConverter; //导入方法依赖的package包/类
/**
* <b>Warning</b> Use of this property requires Java 6.
*
* @param value
*/
public void setMinFreeDiskSpace(String value) {
if (value == null) {
LogLog.warn("Null min free disk space supplied for appender [" + this.getName() + "], defaulting to " + this.getProperties().getMinFreeDiscSpace());
return;
}
value = value.trim();
if ("".equals(value)) {
LogLog.warn("Empty min free disk space supplied for appender [" + this.getName() + "], defaulting to " + this.getProperties().getMinFreeDiscSpace());
return;
}
final long defaultMinFreeDiskSpace = this.getProperties().getMinFreeDiscSpace();
final long minFreeDiskSpace = OptionConverter.toFileSize(value, defaultMinFreeDiskSpace);
this.getProperties().setMinFreeDiscSpace(minFreeDiskSpace);
}
示例3: setMaxFileSize
import org.apache.log4j.helpers.OptionConverter; //导入方法依赖的package包/类
public void setMaxFileSize(String value)
{
maxFileSize = OptionConverter.toFileSize(value, maxFileSize + 1L);
}
示例4: setMaxFileSize
import org.apache.log4j.helpers.OptionConverter; //导入方法依赖的package包/类
public void setMaxFileSize(String value) {
this.maxFileSize = OptionConverter.toFileSize(value, maxFileSize + 1);
}
示例5: setMaxFileSize
import org.apache.log4j.helpers.OptionConverter; //导入方法依赖的package包/类
/**
Set the maximum size that the output file is allowed to reach
before being rolled over to backup files.
<p>In configuration files, the <b>MaxFileSize</b> option takes an
long integer in the range 0 - 2^63. You can specify the value
with the suffixes "KB", "MB" or "GB" so that the integer is
interpreted being expressed respectively in kilobytes, megabytes
or gigabytes. For example, the value "10KB" will be interpreted
as 10240.
*/
public
void setMaxFileSize(String value) {
maxFileSize = OptionConverter.toFileSize(value, maxFileSize + 1);
}
示例6: setMaxFileSize
import org.apache.log4j.helpers.OptionConverter; //导入方法依赖的package包/类
/**
* Set the maximum size that the output file is allowed to reach before being rolled over to backup files.
*
* <p>In configuration files, the <b>MaxFileSize</b> option takes an long integer in the range 0 - 2^63. You can
* specify the value with the suffixes "KB", "MB" or "GB" so that the integer is interpreted being expressed
* respectively in kilobytes, megabytes or gigabytes. For example, the value "10KB" will be interpreted as 10240.
*/
public void setMaxFileSize(String value)
{
maxFileSize = OptionConverter.toFileSize(value, maxFileSize + 1);
}
示例7: setMaxFileSize
import org.apache.log4j.helpers.OptionConverter; //导入方法依赖的package包/类
/**
* Set the maximum size that the output file is allowed to reach before being
* rolled over to backup files.
* <p>
* In configuration files, the <b>MaxFileSize</b> option takes an long integer
* in the range 0 - 2^63. You can specify the value with the suffixes "KB",
* "MB" or "GB" so that the integer is interpreted being expressed
* respectively in kilobytes, megabytes or gigabytes. For example, the value
* "10KB" will be interpreted as 10240.
*/
public void setMaxFileSize(String value) {
maxFileSize = OptionConverter.toFileSize(value, maxFileSize + 1);
}
示例8: setMaxFileSize
import org.apache.log4j.helpers.OptionConverter; //导入方法依赖的package包/类
/**
Set the maximum size that the output file is allowed to reach
before being rolled over to backup files.
<p>In configuration files, the <b>MaxFileSize</b> option takes an
long integer in the range 0 - 2^63. You can specify the value
with the suffixes "KB", "MB" or "GB" so that the integer is
interpreted being expressed respectively in kilobytes, megabytes
or gigabytes. For example, the value "10KB" will be interpreted
as 10240.
*/
public void setMaxFileSize(String value) {
maxFileSize = OptionConverter.toFileSize(value, maxFileSize + 1);
}