Tag Archives: log

Rotating Log Files with Logback

Just fixed an issue related to configuration of Logback recently. You may be wondering why the Logback is used given that it’s much less known than Log4j and Java Logging. Very good question. This page from Logback may provide you some insights. I haven’t tested the performance, but it’s said to be 10 times faster than others. There is also an independent version of comparison on StackOverflow. After browsing it, I didn’t have an impression that I have to use one over the other.

Posted in Software Development | Also tagged , | 1 Response

Harmful Big Data

In one of my recent projects, I got into a “big data” issue. One of the open source components emits so many logs that it quickly fills a hard disk. After isolating problem, I found huge number of log entries by the “find” command in a single log file whose size exceeds 50G – too big data for most system to handle.

The following is an example log entry in the log file:

ff0225bdbac393dc57980619d53f38e4007

Posted in Applications & Tools | Also tagged | Leave a comment

How To Get vCenter Database Records from VMware Support Bundle

If you want to find out the information in the vCenter database, the VMware support bundle comes handy. For example, if you want to analyze the event history, task history, you can dig out these information from the support bundle. By default, the vCenter support bundle is collected as part of the VMware support bundle on standalone client, but not on the vSphere Web Client. So make sure to mark the check box if you want the vCenter info.

Posted in Virtualization | Also tagged , , | Leave a comment

Tips and Tricks in Using Logrotate

In my last article, I talked about how to use logrotate to manage logs. As everything else, there are some tricks that are only learned when using it. Here are a few tricks and tips I learned recently. Hope it can save you some time.

Stickiness of Logrotate Rules

Posted in Applications & Tools | Also tagged , | 1 Response

How to Use Logrotate for Managing Log Files

Logging is an important for software development and operation. Over the time, the log files can grow fast to fill up the disk space. To avoid the problem, log files are rotated, compressed, and deprecated based on certain rules, for example, periodically, over certain size limit, and retention limit.

Most mordern logging frameworks can do log rotation and compression, but different applications may use different frameworks thus configure them differently. If you want to have a solution across different applications for consistent policies, the logrote (https://fedorahosted.org/logrotate/) is a good choice.

Posted in Applications & Tools, Software Development | Also tagged , | 2 Responses

How To Monitor Log File in Real Time and Save New Log To Another File

During software development, we often add lots of logs that help debug and trace the code. When the log files grow bigger, it gets harder to locate the right information of interest. Even we restart the application, the old log remains and new info appends the end of the file unless we delete log file. It’s OK to delete a log file but it’s better to keep it in case for information of previous runs. Here is a trick that I use to make it easier for me to find right log of interest, and it may help you as well.

Posted in Applications & Tools | Also tagged , | Leave a comment

vSphere Support Bundle: How to Collect Anything You Want From ESXi, Not Just Logs

vSphere Client and vSphere Web Client allow administrators to download system logs from different ESXi hosts with choices of predefined groups of information like System, Storage, Network, UserWorld, etc. Under each group, there could be multiple types. For example, under the UserWorld, there are HostAgent and ProcessInformation.

Posted in Virtualization | Also tagged , , | 1 Response

How to Monitor New Changes of Log File with Java

If you have a log file that you want to monitor the incremental changes, you can use the following simple code. Whatever new log entries written to the log will be quickly picked up and printed out to console. It does not interfere with the application that writes the log file. To test the code, you can use any text editor to append more entries to the end of log file (don’t forget to save it).

Posted in Software Development | Also tagged | 1 Response

vCenter and Solutions Logs: How to Change the Settings

Logging is an important tool for system monitoring and troubleshooting. vCenter has comprehensive logs for itself and related solutions. We’ll introduce how to change the settings for these logs in vCenter appliance. One obvious use case is to increase the log levels for troubleshooting.

vCenter Logs
As usual, the vCenter configuration file resides in a subfolder in the /etc folder.

ff0225bdbac393dc57980619d53f38e4056

Posted in Virtualization | Also tagged , | Leave a comment

Simple Logging in Java Application

Logging is a common requirement for application. In Java world, there are a few frameworks, the first and the most famous of which is the log4j from Apache foundation. Java included its own logging APIs afterwards. You can find many discussions which one is better in terms of use of use, flexibility, and performance. To reconcile the two APIs, a common abstraction called Simple Logging Facade for Java (SLF4J) was created. As SLF4J works with both log4j and Java logging, you can switch between them easily (in theory).

Posted in Software Development | Also tagged | 6 Responses

How You Can Use vSphere APIs to Collect vCenter and ESX Logs

If you manage a vSphere infrastructure, you may want to collect logs for troubleshooting, debugging, etc. You can get these logs from vSphere Client manually. You can also use vSphere API to collect them automatically.

The related managed object type in vSphere API is the DiagnosticManager. It helps to access logs from either a vCenter server or ESX server. It has no property but three methods:

1. queryDescriptions() provides a list of diagnostic files for a given system. It takes in an optional parameter host for specifying the HostSystem to extract information from. When you connect to the ESX server directly, the parameter isn’t needed. In vSphere Java API, you just pass in a null. When you connect to the vCenter server and the parameter isn’t specified, the method assumes you’re looking for vCenter logs. The return of this method is an array of DiagnosticManagerLogDescriptor data objects. The data object includes six properties: creator, fileName, format, info, key, and mimeType.

Posted in vSphere API | Also tagged , , , | 4 Responses

How to Enable ESX Server Logs for Troubleshooting

Examining logs is an important way for debugging and troubleshooting a system. There are about ten log files in the ESX server for the hostd agent, which listens API calls, with the same naming pattern as hostd-?.log under the /var/log/vmware directory. The hostd-index file has the number of currently used log files.

The log entry has a similar format to that of VC server logs. Following is a quick sample:

[2008-06-21 07:24:40.769 ‘SOAP’ 64834480 trivia] Received soap request from []: checkForUpdates

The log level can be configured in the /etc/vmware/vpxa.cfg file. Just look for a section like the following. The possible levels are the same as those of VC logs: none, error, warning,info, verbose, or trivia, in an order from less to more detailed messages.

Posted in Virtualization, vSphere API | Also tagged , | 6 Responses
  • NEED HELP?


    My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__ doublecloud.org.

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.