| career | drupal | java | mac | mysql | perl | scala | uml | unix  

JMeter example source code file (logkit.xml)

This example JMeter source code file (logkit.xml) is included in the "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - JMeter tags/keywords

apache, hh:mm:ss, if, it, license, license, sample, sample, see, the, the, this, this, you

The JMeter logkit.xml source code

   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   See the License for the specific language governing permissions and
   limitations under the License.

<logkit logger="system.logkit" log-level="INFO"
    The manager-class is what determines the underlying log implementation
    In this case, it is Avalon LogKit.
    Not sure what logger and log-level are for.

      <factory type="file"

      <!-- Sample entry showing custom format -->
      <file id="logFile" >
         <format type="pattern">
AT: %{time:yyyy/MM/dd HH:mm:ss} PRI: %5.5{priority} CAT: %{category} TEXT: %{message} EX: %{throwable}\n

      <!-- Sample entry showing unique names. SSS = milliseconds -->
      <file id="logUnique" >
         <rotation type="unique" pattern="yyyy-MM-dd-hh-mm-ss-SSS" suffix=".log">
         <!-- can also add a format here -->

        Sample entry showing how to rotate files, i.e. my_log.000001 etc
      <file id="logRevolve" >
         <rotation type="revolving" init="1" max="10">
         <!-- can also add a format here -->


        * must define the default category, i.e. where name = "" 
        * each log-target id-ref must refer to a valid file entry
      <category name="" log-level="INFO">
        <log-target id-ref="logFile"/>
        Further categories can be defined if required; they can have
        the same or different targets, but the targets must exist
      <category name="jorphan" log-level="WARN">
        <log-target id-ref="logRevolver"/>
Documentation extracted from FileTargetFactory class.
This factory is able to create different FileLogTargets according to the 
 following configuration syntax: 
 <file id="foo">
  <format type="avalon|raw|pattern|extended">pattern to be used if needed
  <rotation type="revolving" init="5" max="10">


  <rotation type="unique" pattern="yyyy-MM-dd-hh-mm-ss" suffix=".log">
Some explanations about the Elements used in the configuration: 
     This denotes the name of the file to log to. It can be constructed out of entries in the 
      passed Context object as ${context-key}. This element is required. 
     The type attribute of the pattern element denotes the type of Formatter to be used and 
      according to it the pattern to use for. This elements defaults to: 
%7.7{priority} %5.5{time} [%8.8{category}] (%{context}): %{message}\\n%{throwable} 
<append>      If the log file should be deleted every time the logger is creates (normally at the 
 start of the applcation) or not and thus the log entries will be appended. This elements defaults to 
     This is an optional element. The type attribute determines which FileStrategy to user 
      (revolving=RevolvingFileStrategy, unique=UniqueFileStrategy). The required init and max attribute 
      are used to determine the initial and maximum rotation to use on a type="revolving" attribute. The 
      optional pattern and suffix attribute are used to form filenames on a type="unique" attribute. 
The initial rotation can be set to -1 in which case the system will first create the maximum number 
 of file rotations by selecting the next available rotation and thereafter will overwrite the oldest log 
    uses the OrRotateStrategy to combine the children
     The number of bytes if no suffix used or kilo bytes (1024) if suffixed with 'k' or mega bytes 
      (1024k) if suffixed with 'm' when a file rotation should occur. It doesn't make sense to specify more 
      than one. 
     The time as HH:MM:SS when a rotation should occur. If you like to rotate a logfile more 
      than once a day put an <or> element immediately after the  element and specify the 
      times (and one size, too) inside the <or> element. 
     Rotation occur when string formatted date changed. Specify date formatting pattern. 
     Interval at which a rotation should occur. The interval should be given in the format ddd:

Other JMeter examples (source code examples)

Here is a short list of links related to this JMeter logkit.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller


new blog posts


Copyright 1998-2021 Alvin Alexander,
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.