-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZCS-11112 : Worked on review comments, removed fully qualified names …
…and commented classes
- Loading branch information
1 parent
27e5aa6
commit 01832b4
Showing
8 changed files
with
62 additions
and
160 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
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
27 changes: 0 additions & 27 deletions
27
common/src/java/com/zimbra/common/util/ZimbraPattern2Layout.java
This file was deleted.
Oops, something went wrong.
73 changes: 26 additions & 47 deletions
73
common/src/java/com/zimbra/common/util/ZimbraPatternLayout.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 |
---|---|---|
@@ -1,47 +1,26 @@ | ||
/* | ||
* ***** BEGIN LICENSE BLOCK ***** Zimbra Collaboration Suite Server Copyright | ||
* (C) 2007, 2009, 2010, 2013, 2014, 2016 Synacor, Inc. | ||
* | ||
* 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, see <https://www.gnu.org/licenses/>. ***** | ||
* END LICENSE BLOCK ***** | ||
* | ||
* package com.zimbra.common.util; | ||
* | ||
* import org.apache.log4j.Category; import org.apache.log4j.ConsoleAppender; | ||
* import org.apache.log4j.Layout; import org.apache.log4j.PatternLayout; import | ||
* org.apache.log4j.helpers.PatternParser; | ||
* | ||
*//** | ||
* Subclasses Log4J's <tt>PatternLayout</tt> class to add additional support for | ||
* the <tt>%z</tt> option, which prints the value returned by | ||
* {@link ZimbraLog#getContextString()}. | ||
* | ||
* @author bburtin | ||
*//* | ||
* public class ZimbraPatternLayout extends PatternLayout { | ||
* | ||
* public ZimbraPatternLayout() { this(DEFAULT_CONVERSION_PATTERN); } | ||
* | ||
* public ZimbraPatternLayout(String pattern) { super(pattern); } | ||
* | ||
* public PatternParser createPatternParser(String pattern) { if (pattern == | ||
* null) { pattern = DEFAULT_CONVERSION_PATTERN; } return new | ||
* ZimbraPatternParser(pattern, this); } | ||
* | ||
* public static void main(String[] args) { Layout layout = new | ||
* ZimbraPatternLayout("[%z] - %m%n"); Category cat = | ||
* Category.getInstance("some.cat"); cat.addAppender(new ConsoleAppender(layout, | ||
* ConsoleAppender.SYSTEM_OUT)); | ||
* ZimbraLog.addAccountNameToContext("[email protected]"); | ||
* ZimbraLog.addMboxToContext(99); cat.debug("Hello, log"); | ||
* cat.info("Hello again..."); ZimbraLog.clearContext(); | ||
* cat.info("No more context"); } } | ||
*/ | ||
package com.zimbra.common.util; | ||
|
||
import org.apache.logging.log4j.core.LogEvent; | ||
import org.apache.logging.log4j.core.config.plugins.Plugin; | ||
import org.apache.logging.log4j.core.pattern.ConverterKeys; | ||
import org.apache.logging.log4j.core.pattern.LogEventPatternConverter; | ||
|
||
@Plugin(name = "ZimbraPatternLayout", category = "Converter") | ||
@ConverterKeys({ "z" }) | ||
public class ZimbraPatternLayout extends LogEventPatternConverter { | ||
|
||
protected ZimbraPatternLayout(String name, String style) { | ||
super(name, style); | ||
} | ||
|
||
public static ZimbraPatternLayout newInstance(String[] options) | ||
{ | ||
return new ZimbraPatternLayout("z", Thread.currentThread().getName()); | ||
} | ||
|
||
@Override | ||
public void format(LogEvent event, StringBuilder toAppendTo) { | ||
toAppendTo.append(ZimbraLog.getContextString() == null ? "" : ZimbraLog.getContextString()); | ||
} | ||
|
||
} |
46 changes: 0 additions & 46 deletions
46
common/src/java/com/zimbra/common/util/ZimbraPatternParser.java
This file was deleted.
Oops, something went wrong.
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