cle_clock
Home > wikikonf >  tom/actions/by kikonf > alog







Alog

print

Action : tom.alog   (Category : tom, Name : alog, By : kikonf)
Complete Name : tom.alog.by.kikonf
Version : 4.0        License : Modified BSD License

Purpose of the tom category :
Easy to customize. This category use in background the Kikonf Repoz tools to create and configure Apache Tomcat root installs and Catalina bases at any level (server.xml, hosts or defaults).
You can use it to manage the whole Tomcat Architecture.

Purpose of this alog plugin : This Action describes a Tomcat Access Log Valve

The following shows the main Source Code File for the Action : tom.alog

Toggle lines
##  Copyright (c) 2008, Patrick Germain Placidoux
##  All rights reserved.
##
##  This file is part of Kikonf Public Software.
##
##  Kikonf Public Software is released under the modified BSD License,
##  which should accompany it or any part of it in the file "COPYING".
##  If you do not have this file you can access the license 
##  through the WWW at http://www.kikonf.org/license/bsd/license.txt.
## 
##  Home: http://www.kikonf.org
##  Contact: kikonf@gmx.com


#-- Stores the Action File's Processor Alias
var source_action_alias=ro['alias']

#-- Stores the Action File's First Node
:ls
source_action_node=ro[0]

try:


    ##-- Retreives the Scope
    print
    print '## Retreives the Scope'
    scope_name, scope_attrs, scope=self_action.getScope(parent_node=self_action.getTop(), indent=self_action.getIndent())
    self_action.verbose(scope_name=scope_name, scope_attrs=scope_attrs)    
    indent=self_action.getIndent() + 3*' '

    #--- Stores the target Scope Processor Alias and mount it
    print '#--- Stores the target Scope Processor Alias and mount it'
    var target_scope_alias=scope.pc_ro['alias']
    :mount $target_scope_alias


    ##-- Destroys first
    print    
    print '## Destroys first'
    verbose('AccessLog Valve Removing.', level=self_action.getVerbose(), ifLevel=4, indent=indent, logFile=self_action.getLogFile())
    :rm Valve@className=org.apache.catalina.valves.FastCommonAccessLogValve Valve@className=org.apache.catalina.valves.AccessLogValve
    deleted_nodes=ro
    if deleted_nodes!=None:n=len(deleted_nodes)
    else:n=0
    
    if n>0:verbose('AccessLog Valve Removed:' + str(n) + ' configuration Entry.', level=self_action.getVerbose(), ifLevel=3, indent=indent, logFile=self_action.getLogFile())


    ##-- Creates
    print    
    print '##-- Creates'
    verbose('AccessLog Valve Creating.', level=self_action.getVerbose(), ifLevel=4, indent=indent, logFile=self_action.getLogFile())
    :new Valve
    valve_node=ro[0]    

    #-- Stores the newly created Node
    print '#-- Stores the created Node'

    tattrs=valve_node.getdAttrs()
    sattrs=source_action_node.getdAttrs()

    #-- Updates the newly created Valve node with informations from the Action node.
    print '#-- Updates the newly created Valve node with informations from the Action node.'
    
    for sattr in sattrs:
        if sattr=='fast':
            if sattrs['fast']=='true':className='org.apache.catalina.valves.FastCommonAccessLogValve'
            else:className='org.apache.catalina.valves.AccessLogValve'
            valve_node.setAttr('className', className)
            continue
        
        if sattr not in tattrs:continue # Only manages default
        
        valve_node.setAttr(sattr, sattrs[sattr])
        
    print
    verbose('AccessLog Valve Created.', level=self_action.getVerbose(), ifLevel=3, indent=indent, logFile=self_action.getLogFile())

except Exception, e:
    
    _e=xception.kikonfActionSystemException(self_action, 'inject', 'An exception occures ! SubException is:' + str(e) + ' !')
    _e.setSubException(e)
    REPOZ.recordSessionException(self_action.getName(), _e)
    if self_action.getVerbose()>=10:raise
    # Dont forget to skipt a strict empty line at the end to let the Interpretor to interprete the End of the bloc !

							
(Source: <KIKONF_INSTALLATION_DIR>/plugins/actions/tom/alog/by/kikonf/alog.inject.repoz)


  • Line 1 to 3 say something , say something , say something
  • Line 10 to 17 say something , say something , say something , say something , say something
  • Line 20 to 25 say something



Trademarks :
  • "Apache", "Apache Tomcat" and "Tomcat" are trademarks of the Apache Software Foundation.
  • "Java" and "JVM" are a registred trademarks of Oracle and/or its affiliates.
  • Other names may be trademarks of their respective owners.

Copyright © 2011 - Patrick Placidoux, Hélène Malamoud