MCPcopy Create free account
hub / github.com/apache/trafficserver / init_fields

Method init_fields

src/proxy/logging/Log.cc:316–1021  ·  view source on GitHub ↗

------------------------------------------------------------------------- Log::init_fields Define the available logging fields. This used to be part of the init() function, but now is separate so that standalone programs that do not require more services (e.g., that do not need to read records.yaml) can just call init_fields. Note that the LogFields are added to the list with the cop

Source from the content-addressed store, hash-verified

314 that the LogFieldList destructor will reclaim this memory.
315 -------------------------------------------------------------------------*/
316void
317Log::init_fields()
318{
319 if (init_status & FIELDS_INITIALIZED) {
320 return;
321 }
322
323 LogField *field;
324
325 //
326 // Initializes material to find a milestone name from their
327 // name in a rapid manner.
328 LogField::init_milestone_container();
329
330 // client -> proxy fields
331 field = new LogField("client_host_ip", "chi", LogField::IP, &LogAccess::marshal_client_host_ip, &LogAccess::unmarshal_ip_to_str);
332 global_field_list.add(field, false);
333 field_symbol_hash.emplace("chi", field);
334
335 field =
336 new LogField("client_host_port", "chp", LogField::sINT, &LogAccess::marshal_client_host_port, &LogAccess::unmarshal_int_to_str);
337 global_field_list.add(field, false);
338 field_symbol_hash.emplace("chp", field);
339
340 field =
341 new LogField("client_host_ip_hex", "chih", LogField::IP, &LogAccess::marshal_client_host_ip, &LogAccess::unmarshal_ip_to_hex);
342 global_field_list.add(field, false);
343 field_symbol_hash.emplace("chih", field);
344
345 // remote client (Not necessarily the requesting client IP - See proxy protocol)
346 field = new LogField("remote_host_ip", "rchi", LogField::IP, &LogAccess::marshal_remote_host_ip, &LogAccess::unmarshal_ip_to_str);
347 global_field_list.add(field, false);
348 field_symbol_hash.emplace("rchi", field);
349
350 field = new LogField("remote_host_port", "rchp", LogField::sINT, &LogAccess::marshal_remote_host_port,
351 &LogAccess::unmarshal_int_to_str);
352 global_field_list.add(field, false);
353 field_symbol_hash.emplace("rchp", field);
354
355 field =
356 new LogField("remote_host_ip_hex", "rchh", LogField::IP, &LogAccess::marshal_remote_host_ip, &LogAccess::unmarshal_ip_to_hex);
357 global_field_list.add(field, false);
358 field_symbol_hash.emplace("rchh", field);
359
360 // interface ip
361
362 field =
363 new LogField("host_interface_ip", "hii", LogField::IP, &LogAccess::marshal_host_interface_ip, &LogAccess::unmarshal_ip_to_str);
364 global_field_list.add(field, false);
365 field_symbol_hash.emplace("hii", field);
366
367 field = new LogField("host_interface_ip_hex", "hiih", LogField::IP, &LogAccess::marshal_host_interface_ip,
368 &LogAccess::unmarshal_ip_to_hex);
369 global_field_list.add(field, false);
370 field_symbol_hash.emplace("hiih", field);
371 // interface ip end
372 field = new LogField("client_auth_user_name", "caun", LogField::STRING, &LogAccess::marshal_client_auth_user_name,
373 &LogAccess::unmarshal_str);

Callers

nothing calls this directly

Calls 5

make_ptrFunction · 0.85
make_alias_mapFunction · 0.85
emplaceMethod · 0.80
addMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected