Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

io.github.c-a-services:log4j2-sftp-appender

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

io.github.c-a-services:log4j2-sftp-appender

SFTP appender for log4j2

  • 2018.11.7
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

log4j2-sftp-appender

Append the log-output from log4j2.xml to sftp server

Configuration

log4j2.xml file:

Add the import to the root element:

<Configuration status="warn" packages="io.github.c_a_services.log4j2">

Add the appender:

	<Appenders>
		<DailyFileSftpAppender
			name="sftpAppender"
			filePattern="${date:HHmmssSSS}-mule.log"
			hostName="ftp.yourdnsservername.com"
			pathName="/${sys:stage.name:-nostage}/"
			userName="ftpUserName"
			publicKeyResource="secret/ftpUserName.pub"
			privateKeyResource="secret/ftpUserName"
			passPhrase="yourPassPhrase">
			<PatternLayout pattern="%d %-5p %c{1} - %m [%t]%n" />
         <DefaultRolloverStrategy max="10"/>
		</DailyFileSftpAppender>
	</Appenders>
  • name: will needs to be referenced via <AppenderRef ref="sftpAppender" /> later in the file
  • filepatter: suffix of the files (date will be placed in the beginning always)
  • hostName: ftp hostname
  • pathName: path on that host (here prefixing with system property stage.name)
  • userName: userName to connect with
  • publicKeyResource: resource in your classpath (can be generated via ssh-keygen -f ftpUserName -t rsa -b 4092 -N yourPassPhrase)
  • privateKeyResource: resource in your classpath
  • PatternLayout: Any patternlayout
  • DefaultRolloverStrategy: Days to keep logfiles.

for above example the resourepath looks like: /your-mule-application/src/main/resources/secret/ftpUserName /your-mule-application/src/main/resources/secret/ftpUserName.pub

Further details, see log4j2-configuration

Dependencies

Dependencies are marked provided and so either needs to be available in your server or added manually:

this:
	<dependency>
		<groupId>io.github.c-a-services</groupId>
		<artifactId>log4j2-sftp-appender</artifactId>
		<version>2018.11.1</version>
	</dependency>

(for newest Version see pom.xml)

log4j2:
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
			<version>2.11.1</version>
		</dependency>

(for newest Version see log4j2-maven-artifacts)

sshj:
		<dependency>
			<groupId>com.hierynomus</groupId>
			<artifactId>sshj</artifactId>
			<version>0.26.0</version>
		</dependency>

(for newest Version see sshj)



For changing this file see Markdown-Cheatsheet

FAQs

Package last updated on 21 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc