Method: ManageEngine::APMLogger#getLogsPath

Defined in:
lib/agent/logging/am_logger.rb

#getLogsPathObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/agent/logging/am_logger.rb', line 29

def	getLogsPath
	props = {}
	begin
		if FileTest.exists?(@obj.constants.apm_conf)
		propsFile=File.open(@obj.constants.apm_conf, 'r') 
		propsFile.read.each_line do |line|
			line.strip!
			if (line[0] != ?# and line[0] != ?=)
				i = line.index('=')
				if (i)
					props[line[0..i - 1].strip] = line[i + 1..-1].strip
				else
					props[line] = ''
				end
			end
		end
		else
			puts "ManageEngine Ruby Agent Configuration File Not exist in #{@obj.constants.apm_conf}.\n Duplicate file will be available in <Gems Folder>/apm-agent/lib/config "
		end
	rescue Exception=>e
		puts "Problem in Reading Property File : \n #{e.message} \n  #{e.backtrace}"
	ensure
		#
	end
	if props["apminsight.log.dir"]!=nil
		return props["apminsight.log.dir"]
	else
		return "./log"
	end

end