To enable syslog integration in Cassandra, complete the steps below.
- Log into the Primary node as root via SSH or Console, pressing ALT+F1 in a Console to log in.
- Open /usr/lib/vmware-vcops/user/conf/cassandra/logback.xml in a text editor:
vi /usr/lib/vmware-vcops/user/conf/cassandra/logback.xml
- At the end of the last <appender> node in the <configuration> node section, add the following:
<appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender">
<syslogHost>syslogServerHostName</syslogHost>
<facility>AUTH</facility>
<suffixPattern>%-5level [%thread] %date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC} %-5level [%thread] %F:%L - %msg%n </suffixPattern>
</appender>
- Find the <root> node and add the following to the bottom of that section:
<appender-ref ref="SYSLOG" />
- The <configuration> node should now look similar to the following.
Example:
<configuration scan="true">
<jmxConfigurator />
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${cassandra.logdir}/system.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${cassandra.logdir}/system.log.%i.zip</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>20</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>20MB</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%-5level [%thread] %date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC} %-5level [%thread] %F:%L - %msg%n</pattern>
<!-- old-style log format
<pattern>%5level [%thread] %date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC} %-5level [%thread] %F:%L - %msg%n</pattern>
-->
</encoder>
</appender>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-5level %date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC} %-5level [%thread] %F:%L - %msg%n</pattern>
</encoder>
</appender>
<appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender">
<syslogHost>syslogServerHostName</syslogHost>
<facility>AUTH</facility>
<suffixPattern>%-5level [%thread] %date{yyyy-MM-dd'T'HH:mm:ss.SSSZ, UTC} %-5level [%thread] %F:%L - %msg%n </suffixPattern>
</appender>
<root level="INFO">
<appender-ref ref="FILE" />
<!--<appender-ref ref="STDOUT" />-->
<appender-ref ref="SYSLOG" />
</root>
<logger name="com.thinkaurelius.thrift" level="ERROR"/>
<logger name="org.apache.cassandra.service.MigrationManager" level="DEBUG"/>
<logger name="org.apache.cassandra.service.MigrationTask" level="DEBUG"/>
<!--<logger name="org.apache.cassandra.auth.PasswordAuthenticator" level="TRACE"/>-->
- Save and close the file by typing Esc followed by :q!.
- Repeat steps 1-6 on all other Analytic nodes in the vRealize Operations cluster.