Skip to content

Commit

Permalink
File formatting improvements (#88)
Browse files Browse the repository at this point in the history
* Consistent indentation with spaces (no tabs)

* Consistent line endings

* Consistent newline at EOF

* Remove trailing spaces
  • Loading branch information
darxriggs authored and jakub-bochenski committed Aug 8, 2019
1 parent af6f722 commit 3e1c46c
Show file tree
Hide file tree
Showing 28 changed files with 69 additions and 71 deletions.
1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,3 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Logstash plugin can be used as a publisher in pipeline jobs to send the whole lo

It can be used as a wrapper step to send each log line separately.

Note: when you combine with timestamps step, you should make the timestamps the outer most block. Otherwise you get the timestamps as part of the log lines, basically duplicating the timestamp information.
Note: when you combine with timestamps step, you should make the timestamps the outer most block. Otherwise you get the timestamps as part of the log lines, basically duplicating the timestamp information.

```Groovy
timestamps {
Expand Down Expand Up @@ -73,7 +73,7 @@ Contributing
Adding support for new indexers
-------------------------------

* Implement the extension point `jenkins.plugins.logstash.configuration.LogstashIndexer` that will take your configuration.
* Implement the extension point `jenkins.plugins.logstash.configuration.LogstashIndexer` that will take your configuration.
* Implement `equals()` and `hashCode()`so the plugin can compare new configuration with existing configuration.
* Create a `configure-advanced.jelly` for the UI part of your configuration.
* Create a `help.jelly` with more details about indexer.
Expand Down
1 change: 0 additions & 1 deletion src/main/java/jenkins/plugins/logstash/PluginImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ public DescriptorExtensionList<LogstashIndexer<?>, Descriptor<LogstashIndexer<?>
return LogstashIndexer.all();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ public String getKey()
{
return uri.getPath();
}

public String getMimeType() {
return this.mimeType;
}

public void setMimeType(String mimeType) {
this.mimeType = mimeType;
}
Expand All @@ -166,7 +166,7 @@ public void setCustomKeyStore(KeyStore customKeyStore) throws
SSLHelper.setClientBuilderSSLContext(this.clientBuilder, customKeyStore);
this.customKeyStore = customKeyStore;
}

HttpPost getHttpPost(String data) {
HttpPost postRequest = new HttpPost(uri);
String mimeType = this.getMimeType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ public void push(String data) throws IOException {
out.close();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ enum IndexerType {

@Deprecated
enum SyslogFormat {
RFC5424,
RFC3164
RFC5424,
RFC3164
}

enum SyslogProtocol {
UDP
UDP
}

String getDescription();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<f:section title="${%Logstash}">
<f:optionalBlock name="enabled" title="Enable sending logs to an Indexer" inline="true" field="enabled">
<f:entry>
<f:dropdownDescriptorSelector title="${%Indexer Type}" field="logstashIndexer" descriptors="${descriptor.indexerTypes}"/>
</f:entry>
<f:entry title="Enable Globally" field="enableGlobally" description="This will not enable it for pipeline jobs.">
<f:checkbox/>
</f:entry>
<f:entry title="Use millisecond time stamps" field="milliSecondTimestamps">
<f:checkbox default="true"/>
</f:entry>
<f:entry>
<f:dropdownDescriptorSelector title="${%Indexer Type}" field="logstashIndexer" descriptors="${descriptor.indexerTypes}"/>
</f:entry>
<f:entry title="Enable Globally" field="enableGlobally" description="This will not enable it for pipeline jobs.">
<f:checkbox/>
</f:entry>
<f:entry title="Use millisecond time stamps" field="milliSecondTimestamps">
<f:checkbox default="true"/>
</f:entry>
</f:optionalBlock>
</f:section>
</j:jelly>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Checking will make all non pipeline builds forward their log to the above indexer.
Checking will make all non pipeline builds forward their log to the above indexer.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
By enabling logstash you can send the log output to various indexers like <em>Elastic Search</em> or <em>RabbitMQ</em> (See help of Indexer Type).
By enabling logstash you can send the log output to various indexers like <em>Elastic Search</em> or <em>RabbitMQ</em> (See help of Indexer Type).
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
<dd><st:include class="${descriptor.clazz}" page="help.jelly" optional="true"/></dd>
</dl>
</j:forEach>
</p></j:jelly>
</p></j:jelly>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Use time stamps that include the milliseconds of the event. This should ensure that the indexer will keep the order of events when
they arrive in the same second.
Use time stamps that include the milliseconds of the event. This should ensure that the indexer will keep the order of events when
they arrive in the same second.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<f:optionalBlock name="enable" title="${descriptor.displayName}" checked="${instance != null}" help="/plugin/logstash/help/help.html">
</f:optionalBlock>
<f:optionalBlock name="enable" title="${descriptor.displayName}" checked="${instance != null}" help="/plugin/logstash/help/help.html">
</f:optionalBlock>
</j:jelly>
54 changes: 27 additions & 27 deletions src/main/resources/jenkins/plugins/logstash/Messages.properties
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# The MIT License
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

DisplayName = Send console log to Logstash
ValueIsInt = Value must be an integer
ValueIsRequired = Value is required
PleaseProvideHost = Please set a valid host name
ProvideValidMimeType = Please provide a valid mime type
# The MIT License
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

DisplayName = Send console log to Logstash
ValueIsInt = Value must be an integer
ValueIsRequired = Value is required
PleaseProvideHost = Please set a valid host name
ProvideValidMimeType = Please provide a valid mime type
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
<f:textbox default="${descriptor.defaultPort}"/>
</f:entry>
<st:include page="configure-advanced.jelly" optional="true" class="${descriptor.getId()}"/>
</j:jelly>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
<f:entry title="${%Virtual Host}" field="virtualHost">
<f:textbox default="/"/>
</f:entry>
</j:jelly>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
<f:entry title="${%Key}" field="key">
<f:textbox default="logstash"/>
</f:entry>
</j:jelly>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
<f:entry title="${%Protocol}" field="syslogProtocol">
<f:enum>${it.name()}</f:enum>
</f:entry>
</j:jelly>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<p>Send the tail of the log to Logstash.<br/><br/>
<b>Hint:</b>
In order to get the result in the data sent to Logstash it must be set before the logstashSend step.<br/>
Due to the way log output was collected in older version of the pipeline plugin, the logstashSend step might not
Due to the way log output was collected in older version of the pipeline plugin, the logstashSend step might not
transfer the lines logged directly before the step is called. Adding a sleep of 1 second might help here.
</p>
</div>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div>Send individual log lines to Logstash.</div>
<div>Send individual log lines to Logstash.</div>
4 changes: 2 additions & 2 deletions src/test/resources/buildWrapperConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
<builders/>
<publishers/>
<buildWrappers>
<jenkins.plugins.logstash.LogstashBuildWrapper plugin="[email protected]"/>
<jenkins.plugins.logstash.LogstashBuildWrapper plugin="[email protected]"/>
</buildWrappers>
</project>
</project>
2 changes: 1 addition & 1 deletion src/test/resources/disabled.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
<enabled>false</enabled>
<dataMigrated>true</dataMigrated>
<milliSecondTimestamps>true</milliSecondTimestamps>
</jenkins.plugins.logstash.LogstashConfiguration>
</jenkins.plugins.logstash.LogstashConfiguration>
2 changes: 1 addition & 1 deletion src/test/resources/elasticSearch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
<password>{AQAAABAAAAAQdB13xsx5UlCScGiBcVUOL0GqWYwAU5syhW9iBb6tG+4=}</password>
</logstashIndexer>
<dataMigrated>true</dataMigrated>
</jenkins.plugins.logstash.LogstashConfiguration>
</jenkins.plugins.logstash.LogstashConfiguration>
4 changes: 2 additions & 2 deletions src/test/resources/home/jobs/test/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
<builders/>
<publishers/>
<buildWrappers>
<jenkins.plugins.logstash.LogstashBuildWrapper plugin="[email protected]"/>
<jenkins.plugins.logstash.LogstashBuildWrapper plugin="[email protected]"/>
</buildWrappers>
</project>
</project>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mock-maker-inline
mock-maker-inline
2 changes: 1 addition & 1 deletion src/test/resources/rabbitmq.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
</logstashIndexer>
<dataMigrated>true</dataMigrated>
<milliSecondTimestamps>true</milliSecondTimestamps>
</jenkins.plugins.logstash.LogstashConfiguration>
</jenkins.plugins.logstash.LogstashConfiguration>
2 changes: 1 addition & 1 deletion src/test/resources/rabbitmq_brokenCharset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
</logstashIndexer>
<dataMigrated>true</dataMigrated>
<milliSecondTimestamps>true</milliSecondTimestamps>
</jenkins.plugins.logstash.LogstashConfiguration>
</jenkins.plugins.logstash.LogstashConfiguration>
2 changes: 1 addition & 1 deletion src/test/resources/redis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
<password>{AQAAABAAAAAQAwaAxyveddM0PF+kR0dYFAymdth9PpitQnvJW0SR6JU=}</password>
</logstashIndexer>
<dataMigrated>true</dataMigrated>
</jenkins.plugins.logstash.LogstashConfiguration>
</jenkins.plugins.logstash.LogstashConfiguration>
2 changes: 1 addition & 1 deletion src/test/resources/syslog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
<syslogProtocol>UDP</syslogProtocol>
</logstashIndexer>
<dataMigrated>true</dataMigrated>
</jenkins.plugins.logstash.LogstashConfiguration>
</jenkins.plugins.logstash.LogstashConfiguration>

0 comments on commit 3e1c46c

Please sign in to comment.