@@ -91,6 +91,10 @@ public static IAgentManager Instance
91
91
/// </remarks>
92
92
private AgentManager ( )
93
93
{
94
+ Log . Initialize ( new NewRelic . Core . Logging . FileLogger ( new configurationLog ( ) . GetFullLogFileName ( ) ) ) ;
95
+
96
+ Log . Info ( "AgentManager() constructor" ) ;
97
+
94
98
_container = AgentServices . GetContainer ( ) ;
95
99
AgentServices . RegisterServices ( _container ) ;
96
100
@@ -99,6 +103,7 @@ private AgentManager()
99
103
100
104
configuration config = null ;
101
105
106
+ Log . Info ( "Initializing ConfigurationLoader" ) ;
102
107
try
103
108
{
104
109
config = ConfigurationLoader . Initialize ( ) ;
@@ -118,13 +123,17 @@ private AgentManager()
118
123
119
124
LoggerBootstrapper . ConfigureLogger ( config . LogConfig ) ;
120
125
126
+ Log . Info ( "Checking AgentEnabled..." ) ;
121
127
AssertAgentEnabled ( config ) ;
122
128
129
+ Log . Info ( "Subscribing to Shutdown signal" ) ;
123
130
EventBus < KillAgentEvent > . Subscribe ( OnShutdownAgent ) ;
124
131
132
+ Log . Info ( "Initializing extensions" ) ;
125
133
//Initialize the extensions loader with extensions folder based on the the install path
126
134
ExtensionsLoader . Initialize ( AgentInstallConfiguration . InstallPathExtensionsDirectory ) ;
127
135
136
+ Log . Info ( "Resolving API and wrapper services" ) ;
128
137
// Resolve all services once we've ensured that the agent is enabled
129
138
// The AgentApiImplementation needs to be resolved before the WrapperService, because
130
139
// resolving the WrapperService triggers an agent connect but it doesn't instantiate
@@ -136,15 +145,19 @@ private AgentManager()
136
145
var agentApi = _container . Resolve < IAgentApi > ( ) ;
137
146
_wrapperService = _container . Resolve < IWrapperService > ( ) ;
138
147
148
+ Log . Info ( "Resolving AutoStart" ) ;
139
149
//We need to attempt to auto start the agent once all services have resolved
140
150
_container . Resolve < IConnectionManager > ( ) . AttemptAutoStart ( ) ;
141
151
152
+ Log . Info ( "Starting services" ) ;
142
153
AgentServices . StartServices ( _container ) ;
143
154
155
+ Log . Info ( "API setup" ) ;
144
156
// Setup the internal API first so that AgentApi can use it.
145
157
InternalApi . SetAgentApiImplementation ( agentApi ) ;
146
158
AgentApi . SetSupportabilityMetricCounters ( _container . Resolve < IApiSupportabilityMetricCounters > ( ) ) ;
147
159
160
+ Log . Info ( "Initialize()" ) ;
148
161
Initialize ( ) ;
149
162
_isInitialized = true ;
150
163
}
@@ -165,6 +178,7 @@ private void Initialize()
165
178
var nativeMethods = _container . Resolve < INativeMethods > ( ) ;
166
179
var instrumentationService = _container . Resolve < IInstrumentationService > ( ) ;
167
180
181
+ Log . Info ( "Staring thread profiler" ) ;
168
182
_threadProfilingService = new ThreadProfilingService ( _container . Resolve < IDataTransportService > ( ) , nativeMethods ) ;
169
183
170
184
var commandService = _container . Resolve < CommandService > ( ) ;
@@ -176,6 +190,7 @@ private void Initialize()
176
190
new InstrumentationUpdateCommand ( instrumentationService )
177
191
) ;
178
192
193
+ Log . Info ( "Starting services" ) ;
179
194
StartServices ( ) ;
180
195
LogInitialized ( ) ;
181
196
}
0 commit comments