Defined Type: tomcat::loggingproperties

Defined in:
manifests/loggingproperties.pp

Overview

-Djava.util.logging.config.file

ISO date: java.util.logging.SimpleFormatter.format = %1$tF %1$tT %2$s%n%4$s: %5$s%6$s%n

Parameters:

  • source (Any) (defaults to: undef)
  • catalina_base (Any) (defaults to: "/opt/${name}")
  • logging_properties_file (Any) (defaults to: "/opt/${name}/conf/logging.properties")
  • servicename (Any) (defaults to: $name)
  • simpleformatter_format (Any) (defaults to: '%1$tF %1$tT %2$s%n%4$s: %5$s%6$s%n')


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'manifests/loggingproperties.pp', line 8

define tomcat::loggingproperties(
                                  $source                  = undef,
                                  $catalina_base           = "/opt/${name}",
                                  $logging_properties_file = "/opt/${name}/conf/logging.properties",
                                  $servicename             = $name,
                                  $simpleformatter_format  = '%1$tF %1$tT %2$s%n%4$s: %5$s%6$s%n',
                                ) {

  if ! defined(Class['tomcat'])
  {
    fail('You must include the tomcat base class before using any tomcat defined resources')
  }

  if($servicename!=undef)
  {
    $serviceinstance=Tomcat::Instance::Service[$servicename]
  }
  else
  {
    $serviceinstance=undef
  }

  #java.util.logging.config.file
  tomcat::jvmproperty { "${catalina_base} java.util.logging.config.file":
    property      => 'java.util.logging.config.file',
    value         => $logging_properties_file,
    servicename   => $serviceinstance,
    catalina_base => $catalina_base,
    require       => File[$logging_properties_file],
  }

  if($source!=undef)
  {
    file { $logging_properties_file:
      ensure  => 'present',
      owner   => 'root',
      group   => 'root',
      mode    => '0644',
      require => File["${catalina_base}/conf"],
      notify  => $serviceinstance,
      source  => $source,
    }
  }
  else
  {
    file { $logging_properties_file:
      ensure  => 'present',
      owner   => 'root',
      group   => 'root',
      mode    => '0644',
      require => File["${catalina_base}/conf"],
      notify  => $serviceinstance,
      content => template("${module_name}/properties/logging.properties.erb"),
    }
  }
}