Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added separate logging for each subsystem.
The links to SLF4J libraries have been moved into each subsystem to allow separate logging. A new logging.properties files has been added to each subsystem as well. The pki.policy has been modified to allow Tomcat JULI to read the logging.properties and write log files for each subsystem. https://pagure.io/dogtagpki/issue/195 Change-Id: I6c8b6e6744408e21d620ca1983b2be18c353de73
- Loading branch information
Showing
15 changed files
with
285 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
base/ca/shared/webapps/ca/WEB-INF/classes/logging.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# --- BEGIN COPYRIGHT BLOCK --- | ||
# Copyright (C) 2018 Red Hat, Inc. | ||
# All rights reserved. | ||
# Modifications: configuration parameters | ||
# --- END COPYRIGHT BLOCK --- | ||
|
||
# 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 | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
handlers = org.apache.juli.FileHandler | ||
|
||
org.apache.juli.FileHandler.directory = ${catalina.base}/logs/${classloader.webappName} | ||
org.apache.juli.FileHandler.prefix = debug. | ||
org.apache.juli.FileHandler.maxDays = 7 | ||
org.apache.juli.FileHandler.formatter = org.dogtagpki.tomcat.PKIFormatter | ||
|
||
.level = WARNING | ||
.handler = org.apache.juli.FileHandler | ||
|
||
org.dogtagpki.level = WARNING | ||
com.netscape.level = WARNING | ||
netscape.level = WARNING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
base/kra/shared/webapps/kra/WEB-INF/classes/logging.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# --- BEGIN COPYRIGHT BLOCK --- | ||
# Copyright (C) 2018 Red Hat, Inc. | ||
# All rights reserved. | ||
# Modifications: configuration parameters | ||
# --- END COPYRIGHT BLOCK --- | ||
|
||
# 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 | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
handlers = org.apache.juli.FileHandler | ||
|
||
org.apache.juli.FileHandler.directory = ${catalina.base}/logs/${classloader.webappName} | ||
org.apache.juli.FileHandler.prefix = debug. | ||
org.apache.juli.FileHandler.maxDays = 7 | ||
org.apache.juli.FileHandler.formatter = org.dogtagpki.tomcat.PKIFormatter | ||
|
||
.level = WARNING | ||
.handler = org.apache.juli.FileHandler | ||
|
||
org.dogtagpki.level = WARNING | ||
com.netscape.level = WARNING | ||
netscape.level = WARNING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
base/ocsp/shared/webapps/ocsp/WEB-INF/classes/logging.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# --- BEGIN COPYRIGHT BLOCK --- | ||
# Copyright (C) 2018 Red Hat, Inc. | ||
# All rights reserved. | ||
# Modifications: configuration parameters | ||
# --- END COPYRIGHT BLOCK --- | ||
|
||
# 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 | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
handlers = org.apache.juli.FileHandler | ||
|
||
org.apache.juli.FileHandler.directory = ${catalina.base}/logs/${classloader.webappName} | ||
org.apache.juli.FileHandler.prefix = debug. | ||
org.apache.juli.FileHandler.maxDays = 7 | ||
org.apache.juli.FileHandler.formatter = org.dogtagpki.tomcat.PKIFormatter | ||
|
||
.level = WARNING | ||
.handler = org.apache.juli.FileHandler | ||
|
||
org.dogtagpki.level = WARNING | ||
com.netscape.level = WARNING | ||
netscape.level = WARNING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
base/server/share/webapps/pki/WEB-INF/classes/logging.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# --- BEGIN COPYRIGHT BLOCK --- | ||
# Copyright (C) 2018 Red Hat, Inc. | ||
# All rights reserved. | ||
# Modifications: configuration parameters | ||
# --- END COPYRIGHT BLOCK --- | ||
|
||
# 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 | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
handlers = org.apache.juli.FileHandler | ||
|
||
org.apache.juli.FileHandler.directory = ${catalina.base}/logs/${classloader.webappName} | ||
org.apache.juli.FileHandler.prefix = debug. | ||
org.apache.juli.FileHandler.maxDays = 7 | ||
org.apache.juli.FileHandler.formatter = org.dogtagpki.tomcat.PKIFormatter | ||
|
||
.level = WARNING | ||
.handler = org.apache.juli.FileHandler | ||
|
||
org.dogtagpki.level = WARNING | ||
com.netscape.level = WARNING | ||
netscape.level = WARNING |
49 changes: 49 additions & 0 deletions
49
base/server/tomcat/src/org/dogtagpki/tomcat/PKIFormatter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// --- BEGIN COPYRIGHT BLOCK --- | ||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation; version 2 of the License. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License along | ||
// with this program; if not, write to the Free Software Foundation, Inc., | ||
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
// | ||
// (C) 2018 Red Hat, Inc. | ||
// All rights reserved. | ||
// --- END COPYRIGHT BLOCK --- | ||
|
||
package org.dogtagpki.tomcat; | ||
|
||
import java.util.Date; | ||
import java.util.logging.Formatter; | ||
import java.util.logging.Level; | ||
import java.util.logging.LogRecord; | ||
|
||
public class PKIFormatter extends Formatter { | ||
|
||
public String format(LogRecord record) { | ||
|
||
// 2018-02-23 10:18:51 [main] INFO: Log message | ||
|
||
return String.format( | ||
"%1$tF %1$tT [%2$s] %3$s: %4$s%n", | ||
new Date(record.getMillis()), | ||
Thread.currentThread().getName(), | ||
record.getLevel(), | ||
formatMessage(record)); | ||
} | ||
|
||
public static void main(String[] args) { | ||
|
||
PKIFormatter formatter = new PKIFormatter(); | ||
|
||
LogRecord record = new LogRecord(Level.INFO, "Log message"); | ||
record.setSourceClassName(PKIFormatter.class.getName()); | ||
|
||
System.out.println(formatter.format(record)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
base/tks/shared/webapps/tks/WEB-INF/classes/logging.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# --- BEGIN COPYRIGHT BLOCK --- | ||
# Copyright (C) 2018 Red Hat, Inc. | ||
# All rights reserved. | ||
# Modifications: configuration parameters | ||
# --- END COPYRIGHT BLOCK --- | ||
|
||
# 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 | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
handlers = org.apache.juli.FileHandler | ||
|
||
org.apache.juli.FileHandler.directory = ${catalina.base}/logs/${classloader.webappName} | ||
org.apache.juli.FileHandler.prefix = debug. | ||
org.apache.juli.FileHandler.maxDays = 7 | ||
org.apache.juli.FileHandler.formatter = org.dogtagpki.tomcat.PKIFormatter | ||
|
||
.level = WARNING | ||
.handler = org.apache.juli.FileHandler | ||
|
||
org.dogtagpki.level = WARNING | ||
com.netscape.level = WARNING | ||
netscape.level = WARNING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
base/tps/shared/webapps/tps/WEB-INF/classes/logging.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# --- BEGIN COPYRIGHT BLOCK --- | ||
# Copyright (C) 2018 Red Hat, Inc. | ||
# All rights reserved. | ||
# Modifications: configuration parameters | ||
# --- END COPYRIGHT BLOCK --- | ||
|
||
# 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 | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
handlers = org.apache.juli.FileHandler | ||
|
||
org.apache.juli.FileHandler.directory = ${catalina.base}/logs/${classloader.webappName} | ||
org.apache.juli.FileHandler.prefix = debug. | ||
org.apache.juli.FileHandler.maxDays = 7 | ||
org.apache.juli.FileHandler.formatter = org.dogtagpki.tomcat.PKIFormatter | ||
|
||
.level = WARNING | ||
.handler = org.apache.juli.FileHandler | ||
|
||
org.dogtagpki.level = WARNING | ||
com.netscape.level = WARNING | ||
netscape.level = WARNING |