YOUR CODE IS NEARLY CORRECT AND THE TRADITIONAL WAY
There are many ways to realize a solution. I believe the best way is to do it the most simple way. You do not need sizes, percentages or transformations to realize a universal working solution.
To do that your code is on the way and nearly correct. At the end you missed only one property to get your solution running. And indeed your code is the common and easiest technique to for realising an universal centered layer element to any parent container.
I added the property and cleaned your code up from not needed elements. Just see comments in the code.
.container {
/* needed */
position: relative;
/*
for testing/demonstration
make container visible for testing
THIS color must be covered completely from inner centered div
*/
background: magenta;
margin: 20px auto;
width: 300px;
height: 200px;
}
.center_xy {
/*
centering part
ONLY NEEDED CODE FOR ABSOLUTE CENTERING
= typical code to realize a overlay layer
it covers the parent div autmatically WITHOUT using fix or percentage sizes
*/
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
z-index: 10;
/*
your styling part
adding background image
you only missed to add the position to the background image
*/
background-image: url('https://dummyimage.com/100x100/006400/fff.png&text=-+logo+-');
background-repeat: no-repeat;
/*
THIS IS WHAT YOU MISSED
add position to background image
*/
background-position: center;
/*
some cleanup
not needed ....
width: 100%;
height: 100%;
background-size: auto;
*/
/*
testing part
make centered container visible
this color has to cover all ...
*/
background-color: yellow;
}
<div class="container">
<div class="center_xy"></div>
</div>
UPDATE
Just a polite additional notice. If there is no other reason than to position a logo centered in an otherwise empty positioning-wrapper/container I would like to add the polite hint ... in THAT case an overlay element is not needed. In THAT case you could add the logo image by css direct centered to the background as seen in the example ... or use property flexbox
to easy xy centering the logo added in html by <img>
tag.