From: <fg...@us...> - 2009-02-21 17:49:46
|
Revision: 1051 http://openutils.svn.sourceforge.net/openutils/?rev=1051&view=rev Author: fgiust Date: 2009-02-21 17:49:38 +0000 (Sat, 21 Feb 2009) Log Message: ----------- ready for 2.0.4 Modified Paths: -------------- trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java trunk/openutils-log4j/src/site/changes/changes.xml Modified: trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java =================================================================== --- trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java 2009-02-20 21:38:47 UTC (rev 1050) +++ trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java 2009-02-21 17:49:38 UTC (rev 1051) @@ -73,10 +73,12 @@ * <param name="ConversionPattern" value="%-5p %c %d{dd.MM.yyyy HH:mm:ss} -- %m%n" /> * <param name="Header" * value=" - * =================================== - * Myapp (production environment) - * Date: %d{dd.MM.yyyy HH:mm:ss} - * =================================== + * ===================================%n + * Myapp (production environment)%n + * Date: %d{dd.MM.yyyy HH:mm:ss}%n + * Url: %X{url}%n + * Number of occurrences: %o%n + * ===================================%n * " /> * </layout> * </appender> @@ -123,6 +125,8 @@ private Layout subjectLayout; + private Layout headerLayout; + private String smtpHost; private boolean locationInfo; @@ -204,6 +208,8 @@ event.getThreadName(); event.getNDC(); + event.getMDCCopy(); + if (locationInfo) { event.getLocationInformation(); @@ -348,17 +354,26 @@ MimeBodyPart part = new MimeBodyPart(); StringBuffer sbuf = new StringBuffer(); - String t = layout.getHeader(); - if (t != null) + + LoggingEvent event = lea.getLoggingEvent(); + + if (layout.getHeader() != null) { - t = StringUtils.replace(t, "%o", Integer.toString(lea.getCount())); - t = StringUtils.replace(t, "%n", Layout.LINE_SEP); - sbuf.append(t); - sbuf.append("\n"); + if (headerLayout == null) + { + String header = layout.getHeader(); + header = StringUtils.replace(header, "%o", "{number_of_occurrences}"); + headerLayout = new PatternLayout(header); + } + String t = headerLayout.format(event); + if (t != null) + { + t = StringUtils.replace(t, "{number_of_occurrences}", Integer.toString(lea.getCount())); + sbuf.append(t); + sbuf.append("\n"); + } } - LoggingEvent event = lea.getLoggingEvent(); - if (this.subjectLayout != null) { String subject = this.subjectLayout.format(event); @@ -387,7 +402,7 @@ } } } - t = layout.getFooter(); + String t = layout.getFooter(); if (t != null) { t = StringUtils.replace(t, "%n", Layout.LINE_SEP); @@ -462,8 +477,8 @@ } /** - * The <b>SMTPHost</b> option takes a string value which should be a the host name of the SMTP server that will - * send the e-mail message. + * The <b>SMTPHost</b> option takes a string value which should be a the host name of the SMTP server that will send + * the e-mail message. */ public void setSMTPHost(String smtpHost) { @@ -496,9 +511,9 @@ } /** - * The <b>EvaluatorClass</b> option takes a string value representing the name of the class implementing the {@link - * TriggeringEventEvaluator} interface. A corresponding object will be instantiated and assigned as the triggering - * event evaluator for the SMTPAppender. + * The <b>EvaluatorClass</b> option takes a string value representing the name of the class implementing the + * {@link TriggeringEventEvaluator} interface. A corresponding object will be instantiated and assigned as the + * triggering event evaluator for the SMTPAppender. */ public void setEvaluatorClass(String value) { @@ -517,10 +532,9 @@ } /** - * The <b>LocationInfo</b> option takes a boolean value. By default, it is set to false which means there will be - * no effort to extract the location information related to the event. As a result, the layout that formats the - * events as they are sent out in an e-mail is likely to place the wrong location information (if present in the - * format). + * The <b>LocationInfo</b> option takes a boolean value. By default, it is set to false which means there will be no + * effort to extract the location information related to the event. As a result, the layout that formats the events + * as they are sent out in an e-mail is likely to place the wrong location information (if present in the format). * <p> * Location information extraction is comparatively very slow and should be avoided unless performance is not a * concern. Modified: trunk/openutils-log4j/src/site/changes/changes.xml =================================================================== --- trunk/openutils-log4j/src/site/changes/changes.xml 2009-02-20 21:38:47 UTC (rev 1050) +++ trunk/openutils-log4j/src/site/changes/changes.xml 2009-02-21 17:49:38 UTC (rev 1051) @@ -8,6 +8,11 @@ <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> </properties> <body> + <release version="2.0.4" date="2009-02-21" description="2.0.4"> + <action type="add" dev="fgiust">Added support for using MDC in AlternateSMTPAppender</action> + <action type="add" dev="fgiust">AlternateSMTPAppender now handles the layour header as a + PatternLayout and not as a static String anymore.</action> + </release> <release version="2.0.3" date="2009-01-31" description="2.0.3"> <action type="update" dev="fgiust"> Updated log4j dependency to 1.2.15 with the necessary exclusion (1.2.15 brings in several optional/unwanted dependencies with maven)</action> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mmu...@us...> - 2010-02-10 14:10:00
|
Revision: 1874 http://openutils.svn.sourceforge.net/openutils/?rev=1874&view=rev Author: mmunaretto Date: 2010-02-10 14:09:49 +0000 (Wed, 10 Feb 2010) Log Message: ----------- added license to source code Modified Paths: -------------- trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java trunk/openutils-log4j/src/main/java/it/openutils/log4j/DynamicSubjectSMTPAppender.java trunk/openutils-log4j/src/main/java/it/openutils/log4j/EnhancedDailyRollingFileAppender.java trunk/openutils-log4j/src/main/java/it/openutils/log4j/FilteredPatternLayout.java trunk/openutils-log4j/src/main/java/it/openutils/log4j/Log4jConfigurationServlet.java trunk/openutils-log4j/src/test/java/it/openutils/log4j/FilteredPatternLayoutTest.java Added Paths: ----------- trunk/openutils-log4j/src/main/etc/ trunk/openutils-log4j/src/main/etc/header.txt Added: trunk/openutils-log4j/src/main/etc/header.txt =================================================================== --- trunk/openutils-log4j/src/main/etc/header.txt (rev 0) +++ trunk/openutils-log4j/src/main/etc/header.txt 2010-02-10 14:09:49 UTC (rev 1874) @@ -0,0 +1,15 @@ + +${name} (${url}) +Copyright(C) ${year}, Openmind S.r.l. http://www.openmindonline.it + + Licensed 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. \ No newline at end of file Property changes on: trunk/openutils-log4j/src/main/etc/header.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java =================================================================== --- trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java 2010-02-10 11:02:22 UTC (rev 1873) +++ trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java 2010-02-10 14:09:49 UTC (rev 1874) @@ -1,17 +1,19 @@ -/* - * Copyright Openmind http://www.openmindonline.it +/** * - * Licensed 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 + * openutils for Log4j (http://www.openmindlab.com/lab/products/openutilslog4j.html) + * Copyright(C) null-2010, Openmind S.r.l. http://www.openmindonline.it * - * http://www.apache.org/licenses/LICENSE-2.0 + * Licensed 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, - * 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. + * 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. */ package it.openutils.log4j; Modified: trunk/openutils-log4j/src/main/java/it/openutils/log4j/DynamicSubjectSMTPAppender.java =================================================================== --- trunk/openutils-log4j/src/main/java/it/openutils/log4j/DynamicSubjectSMTPAppender.java 2010-02-10 11:02:22 UTC (rev 1873) +++ trunk/openutils-log4j/src/main/java/it/openutils/log4j/DynamicSubjectSMTPAppender.java 2010-02-10 14:09:49 UTC (rev 1874) @@ -1,18 +1,21 @@ -/* - * Copyright Openmind http://www.openmindonline.it +/** * - * Licensed 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 + * openutils for Log4j (http://www.openmindlab.com/lab/products/openutilslog4j.html) + * Copyright(C) null-2010, Openmind S.r.l. http://www.openmindonline.it * - * http://www.apache.org/licenses/LICENSE-2.0 + * Licensed 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, - * 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. + * 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. */ + package it.openutils.log4j; /** Modified: trunk/openutils-log4j/src/main/java/it/openutils/log4j/EnhancedDailyRollingFileAppender.java =================================================================== --- trunk/openutils-log4j/src/main/java/it/openutils/log4j/EnhancedDailyRollingFileAppender.java 2010-02-10 11:02:22 UTC (rev 1873) +++ trunk/openutils-log4j/src/main/java/it/openutils/log4j/EnhancedDailyRollingFileAppender.java 2010-02-10 14:09:49 UTC (rev 1874) @@ -1,18 +1,21 @@ -/* - * Copyright Openmind http://www.openmindonline.it +/** * - * Licensed 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 + * openutils for Log4j (http://www.openmindlab.com/lab/products/openutilslog4j.html) + * Copyright(C) null-2010, Openmind S.r.l. http://www.openmindonline.it * - * http://www.apache.org/licenses/LICENSE-2.0 + * Licensed 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, - * 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. + * 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. */ + package it.openutils.log4j; import java.io.File; Modified: trunk/openutils-log4j/src/main/java/it/openutils/log4j/FilteredPatternLayout.java =================================================================== --- trunk/openutils-log4j/src/main/java/it/openutils/log4j/FilteredPatternLayout.java 2010-02-10 11:02:22 UTC (rev 1873) +++ trunk/openutils-log4j/src/main/java/it/openutils/log4j/FilteredPatternLayout.java 2010-02-10 14:09:49 UTC (rev 1874) @@ -1,18 +1,21 @@ -/* - * Copyright 2005 Fabrizio Giustina. +/** * - * Licensed 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 + * openutils for Log4j (http://www.openmindlab.com/lab/products/openutilslog4j.html) + * Copyright(C) null-2010, Openmind S.r.l. http://www.openmindonline.it * - * http://www.apache.org/licenses/LICENSE-2.0 + * Licensed 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, - * 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. + * 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. */ + package it.openutils.log4j; import java.util.HashSet; Modified: trunk/openutils-log4j/src/main/java/it/openutils/log4j/Log4jConfigurationServlet.java =================================================================== --- trunk/openutils-log4j/src/main/java/it/openutils/log4j/Log4jConfigurationServlet.java 2010-02-10 11:02:22 UTC (rev 1873) +++ trunk/openutils-log4j/src/main/java/it/openutils/log4j/Log4jConfigurationServlet.java 2010-02-10 14:09:49 UTC (rev 1874) @@ -1,18 +1,21 @@ -/* - * Copyright 2005 Fabrizio Giustina.. +/** * - * Licensed 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 + * openutils for Log4j (http://www.openmindlab.com/lab/products/openutilslog4j.html) + * Copyright(C) null-2010, Openmind S.r.l. http://www.openmindonline.it * - * http://www.apache.org/licenses/LICENSE-2.0 + * Licensed 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, - * 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. + * 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. */ + package it.openutils.log4j; import java.io.IOException; Modified: trunk/openutils-log4j/src/test/java/it/openutils/log4j/FilteredPatternLayoutTest.java =================================================================== --- trunk/openutils-log4j/src/test/java/it/openutils/log4j/FilteredPatternLayoutTest.java 2010-02-10 11:02:22 UTC (rev 1873) +++ trunk/openutils-log4j/src/test/java/it/openutils/log4j/FilteredPatternLayoutTest.java 2010-02-10 14:09:49 UTC (rev 1874) @@ -1,3 +1,21 @@ +/** + * + * openutils for Log4j (http://www.openmindlab.com/lab/products/openutilslog4j.html) + * Copyright(C) null-2010, Openmind S.r.l. http://www.openmindonline.it + * + * Licensed 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. + */ + package it.openutils.log4j; import junit.framework.TestCase; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <die...@us...> - 2011-08-26 09:14:48
|
Revision: 3661 http://openutils.svn.sourceforge.net/openutils/?rev=3661&view=rev Author: diego_schivo Date: 2011-08-26 09:14:42 +0000 (Fri, 26 Aug 2011) Log Message: ----------- mvn license:format Modified Paths: -------------- trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java trunk/openutils-log4j/src/main/java/it/openutils/log4j/DynamicSubjectSMTPAppender.java trunk/openutils-log4j/src/main/java/it/openutils/log4j/EnhancedDailyRollingFileAppender.java trunk/openutils-log4j/src/main/java/it/openutils/log4j/FilteredPatternLayout.java trunk/openutils-log4j/src/main/java/it/openutils/log4j/Log4jConfigurationServlet.java trunk/openutils-log4j/src/test/java/it/openutils/log4j/FilteredPatternLayoutTest.java Modified: trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java =================================================================== --- trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java 2011-08-26 09:02:21 UTC (rev 3660) +++ trunk/openutils-log4j/src/main/java/it/openutils/log4j/AlternateSMTPAppender.java 2011-08-26 09:14:42 UTC (rev 3661) @@ -1,7 +1,7 @@ /** * * openutils for Log4j (http://www.openmindlab.com/lab/products/openutilslog4j.html) - * Copyright(C) ${project.inceptionYear}-2011, Openmind S.r.l. http://www.openmindonline.it + * Copyright(C) null-2011, Openmind S.r.l. http://www.openmindonline.it * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Modified: trunk/openutils-log4j/src/main/java/it/openutils/log4j/DynamicSubjectSMTPAppender.java =================================================================== --- trunk/openutils-log4j/src/main/java/it/openutils/log4j/DynamicSubjectSMTPAppender.java 2011-08-26 09:02:21 UTC (rev 3660) +++ trunk/openutils-log4j/src/main/java/it/openutils/log4j/DynamicSubjectSMTPAppender.java 2011-08-26 09:14:42 UTC (rev 3661) @@ -1,7 +1,7 @@ /** * * openutils for Log4j (http://www.openmindlab.com/lab/products/openutilslog4j.html) - * Copyright(C) ${project.inceptionYear}-2011, Openmind S.r.l. http://www.openmindonline.it + * Copyright(C) null-2011, Openmind S.r.l. http://www.openmindonline.it * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Modified: trunk/openutils-log4j/src/main/java/it/openutils/log4j/EnhancedDailyRollingFileAppender.java =================================================================== --- trunk/openutils-log4j/src/main/java/it/openutils/log4j/EnhancedDailyRollingFileAppender.java 2011-08-26 09:02:21 UTC (rev 3660) +++ trunk/openutils-log4j/src/main/java/it/openutils/log4j/EnhancedDailyRollingFileAppender.java 2011-08-26 09:14:42 UTC (rev 3661) @@ -1,7 +1,7 @@ /** * * openutils for Log4j (http://www.openmindlab.com/lab/products/openutilslog4j.html) - * Copyright(C) ${project.inceptionYear}-2011, Openmind S.r.l. http://www.openmindonline.it + * Copyright(C) null-2011, Openmind S.r.l. http://www.openmindonline.it * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Modified: trunk/openutils-log4j/src/main/java/it/openutils/log4j/FilteredPatternLayout.java =================================================================== --- trunk/openutils-log4j/src/main/java/it/openutils/log4j/FilteredPatternLayout.java 2011-08-26 09:02:21 UTC (rev 3660) +++ trunk/openutils-log4j/src/main/java/it/openutils/log4j/FilteredPatternLayout.java 2011-08-26 09:14:42 UTC (rev 3661) @@ -1,7 +1,7 @@ /** * * openutils for Log4j (http://www.openmindlab.com/lab/products/openutilslog4j.html) - * Copyright(C) ${project.inceptionYear}-2011, Openmind S.r.l. http://www.openmindonline.it + * Copyright(C) null-2011, Openmind S.r.l. http://www.openmindonline.it * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Modified: trunk/openutils-log4j/src/main/java/it/openutils/log4j/Log4jConfigurationServlet.java =================================================================== --- trunk/openutils-log4j/src/main/java/it/openutils/log4j/Log4jConfigurationServlet.java 2011-08-26 09:02:21 UTC (rev 3660) +++ trunk/openutils-log4j/src/main/java/it/openutils/log4j/Log4jConfigurationServlet.java 2011-08-26 09:14:42 UTC (rev 3661) @@ -1,7 +1,7 @@ /** * * openutils for Log4j (http://www.openmindlab.com/lab/products/openutilslog4j.html) - * Copyright(C) ${project.inceptionYear}-2011, Openmind S.r.l. http://www.openmindonline.it + * Copyright(C) null-2011, Openmind S.r.l. http://www.openmindonline.it * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Modified: trunk/openutils-log4j/src/test/java/it/openutils/log4j/FilteredPatternLayoutTest.java =================================================================== --- trunk/openutils-log4j/src/test/java/it/openutils/log4j/FilteredPatternLayoutTest.java 2011-08-26 09:02:21 UTC (rev 3660) +++ trunk/openutils-log4j/src/test/java/it/openutils/log4j/FilteredPatternLayoutTest.java 2011-08-26 09:14:42 UTC (rev 3661) @@ -1,7 +1,7 @@ /** * * openutils for Log4j (http://www.openmindlab.com/lab/products/openutilslog4j.html) - * Copyright(C) ${project.inceptionYear}-2011, Openmind S.r.l. http://www.openmindonline.it + * Copyright(C) null-2011, Openmind S.r.l. http://www.openmindonline.it * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |